Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TESTED ON PERRO UNDER STEPHANE USER :
- processor : 3
- model name : Genuine Intel(R) CPU 3.20GHz
- CREATE TABLE `login` (
- `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `user_name` varchar(50) DEFAULT NULL,
- `user_email` varchar(255) DEFAULT NULL,
- `created` datetime DEFAULT NULL,
- PRIMARY KEY (`user_id`)
- ) ENGINE=MyISAM AUTO_INCREMENT=1000000 DEFAULT CHARSET=latin1
- ./my sqlslap -ustephane test -p --create-schema=test --query="HANDLER login READ \`PRIMARY\`=(10000)" --concurrency=4 --number-of-queries=10000000
- init_connect='use test;HANDLER login OPEN;'
- REFERENCE ON MYSQL 5.5 SELECT * from login where user_id=1000
- mysql [localhost] {msandbox} (performance_schema) > SELECT EVENT_NAME, COUNT_STAR FROM events_waits_summary_global_by_event_name ORDER BY COUNT_STAR DESC LIMIT 10;
- +--------------------------------------------+------------+
- | EVENT_NAME | COUNT_STAR |
- +--------------------------------------------+------------+
- | wait/synch/mutex/sql/THD::LOCK_thd_data | 4951736 |
- | wait/synch/mutex/innodb/kernel_mutex | 3008929 |
- | wait/synch/rwlock/sql/MDL_lock::rwlock | 3008373 |
- | wait/synch/mutex/sql/LOCK_open | 2006001 |
- | wait/synch/mutex/mysys/THR_LOCK::mutex | 2005879 |
- | wait/synch/mutex/sql/MDL_map::mutex | 1003036 |
- | wait/synch/rwlock/sql/LOCK_grant | 1002829 |
- | wait/synch/rwlock/innodb/btr_search_latch | 1002769 |
- | wait/synch/mutex/innodb/mutex_list_mutex | 16569 |
- | wait/synch/mutex/innodb/rw_lock_list_mutex | 16465 |
- +--------------------------------------------+------------+
- | Bytes_received | 648475 |
- | Com_select | 15080 |
- | Handler_commit | 15081 |
- | Handler_read_key | 30160 |
- | Innodb_buffer_pool_read_requests | 30181 |
- | Innodb_rows_read | 14979 |
- mysql [localhost] {msandbox} (test) > Benchmark
- Average number of seconds to run all queries: 323.958 seconds
- Minimum number of seconds to run all queries: 323.958 seconds
- Maximum number of seconds to run all queries: 323.958 seconds
- Number of clients running queries: 8
- Average number of queries per client: 1250000
- 30864 qps
- MariaDB 5.2.3 MyISAM
- query_cache_type=0
- innodb_buffer_pool_size=250M
- key_cache_segments=64
- key_buffer_size=256M
- +--------------------+----------+
- | Status | Duration |
- +--------------------+----------+
- | starting | 0.000057 |
- | System lock | 0.000008 |
- | Table lock | 0.000045 |
- | query end | 0.000006 |
- | freeing items | 0.000013 |
- | logging slow query | 0.000006 |
- | cleaning up | 0.000005 |
- +--------------------+----------+
- stephane@perro:~/sandboxes/msb_5_2_3> time ./my sqlslap -ustephane test -p --create-schema=test --query="HANDLER login READ \`PRIMARY\`=(10000)" --concurrency=8 --number-of-queries=10000000
- Enter password:
- Benchmark
- Average number of seconds to run all queries: 326.757 seconds
- Minimum number of seconds to run all queries: 326.757 seconds
- Maximum number of seconds to run all queries: 326.757 seconds
- Number of clients running queries: 8
- Average number of queries per client: 1250000
- real 5m27.802s
- user 2m55.871s
- sys 3m2.723s
- +---------------------------------------+------------+
- | Variable_name | Value |
- +---------------------------------------+------------+
- | Bytes_sent | 9408004 |
- | Com_ha_read | 30717 |
- | Handler_read_key | 30718 |
- | Key_read_requests | 123062 |
- | Queries | 30719 |
- | Questions | 30719 |
- | Table_locks_immediate | 30775 |
- +---------------------------------------+------------+
- | Variable_name | Value |
- +---------------------------------------+------------+
- | Bytes_sent | 9410758 |
- | Com_ha_read | 30728 |
- | Handler_read_key | 30725 |
- | Key_read_requests | 122895 |
- procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
- r b swpd free buff cache si so bi bo in cs us sy id wa
- 9 0 120 628480 83936 1010752 0 0 1 117 1 3 3 0 96 1
- 10 0 120 628480 83936 1010784 0 0 0 0 1109 123640 65 35 0 0
- 9 0 120 628480 83936 1010784 0 0 0 26 1137 123198 65 35 0 0
- 10 0 120 628464 83936 1010784 0 0 0 0 1050 123453 64 36 0 0
- 8 0 120 628464 83936 1010784 0 0 0 0 1061 123534 66 34 0 0
- 9 0 120 628464 83936 1010784 0 0 0 76 1088 123548 63 37 0 0
- 8 0 120 628464 83936 1010784 0 0 0 0 1053 122171 64 36 0 0
- Oprofile :
- 566426 23.4969 /no-vmlinux /home/stephane/5.2.3/bin/mysqld /no-vmlinux
- 353985 14.6842 /no-vmlinux /home/stephane/5.2.3/bin/mysqlslap /no-vmlinux
- 131994 5.4755 /lib64/libc-2.9.so /home/stephane/5.2.3/bin/mysqld /lib64/libc-2.9.so
- 126725 5.2569 /lib64/libc-2.9.so /home/stephane/5.2.3/bin/mysqlslap /lib64/libc-2.9.so
- 78529 3.2576 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld MYSQLparse(void*)
- 52751 2.1883 /lib64/libpthread-2.9.so /home/stephane/5.2.3/bin/mysqld pthread_mutex_lock
- 38664 1.6039 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld MYSQLlex(void*, void*)
- 36848 1.5286 /usr/bin/oprofiled /usr/bin/oprofiled /usr/bin/oprofiled
- 32702 1.3566 /no-vmlinux /no-vmlinux /no-vmlinux
- 26797 1.1116 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld Protocol::net_store_data(unsigned char const*, unsigned long, charset_info_st const*, charset_info_st const*)
- 26756 1.1099 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld find_key_block
- 22769 0.9445 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld bmove512
- 22696 0.9415 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld mysql_ha_read(THD*, TABLE_LIST*, enum_ha_read_modes, char*, List<Item>*, ha_rkey_function, Item*, unsigned long long, unsigned long long)
- 19845 0.8232 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld dispatch_command(enum_server_command, THD*, char*, unsigned int)
- 19521 0.8098 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld Protocol::send_fields(List<Item>*, unsigned int)
- 19283 0.7999 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld copy_and_convert(char*, unsigned int, charset_info_st const*, char const*, unsigned int, charset_info_st const*, unsigned int*)
- 18953 0.7862 /lib64/libpthread-2.9.so /home/stephane/5.2.3/bin/mysqld __pthread_mutex_unlock_usercnt
- 18761 0.7783 /home/stephane/5.2.3/bin/mysqlslap /home/stephane/5.2.3/bin/mysqlslap cli_read_rows
- 18646 0.7735 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld ha_key_cmp
- 18421 0.7642 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld simple_key_cache_read
- 16992 0.7049 /home/stephane/5.2.3/bin/mysqlslap /home/stephane/5.2.3/bin/mysqlslap my_real_read
- 14467 0.6001 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld insert_fields(THD*, Name_resolution_context*, char const*, char const*, List_iterator<Item>*, bool)
- 12763 0.5294 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld alloc_root
- 12575 0.5216 /home/stephane/5.2.3/bin/mysqlslap /home/stephane/5.2.3/bin/mysqlslap alloc_root
- 12215 0.5067 /home/stephane/5.2.3/bin/mysqld /home/stephane/5.2.3/bin/mysqld _mi_bin_search
- 11190 0.4642 /home/stephane/5.2.3/bin/mysqlslap /home/stephane/5.2.3/bin/mysqlslap vio_read_buff
- 11121 0.4613 /lib64/libpthread-2.9.so /home/stephane/5.2.3/bin/mysqld pthread_getspecific
- MariaDB 5.2.3 XtraDB
- mysql [localhost] {stephane} (test) > show profile for query 1;
- +--------------------+----------+
- | Status | Duration |
- +--------------------+----------+
- | starting | 0.000052 |
- | System lock | 0.000007 |
- | Table lock | 0.000073 |
- | query end | 0.000006 |
- | freeing items | 0.000017 |
- | logging slow query | 0.000005 |
- | cleaning up | 0.000005 |
- +--------------------+----------+
- 7 rows in set (0.01 sec)
- | Handler_read_key | 30770 |
- procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
- 21:24 svaroqui r b swpd free buff cache si so bi bo in cs us sy id wa
- 21:24 svaroqui 7 0 120 17128 379060 1281564 0 0 1 119 4 4 3 0 96 1
- 21:24 svaroqui 2 4 0 120 17000 379060 1281600 0 0 0 0 1044 125528 63 36 1 0
- 21:24 svaroqui 4 0 120 17000 379060 1281600 0 0 0 22 1046 125350 62 38 1 0
- MySQL 5.5 - MyISAM -READ \`PRIMARY\`=(10000)
- mysql [localhost] {root} (performance_schema) > SELECT EVENT_NAME, COUNT_STAR FROM events_waits_summary_global_by_event_name ORDER BY COUNT_STAR DESC LIMIT 10;
- +------------------------------------------------------+------------+
- | EVENT_NAME | COUNT_STAR |
- +------------------------------------------------------+------------+
- | wait/synch/mutex/mysys/KEY_CACHE::cache_lock | 58256213 |
- | wait/synch/mutex/sql/THD::LOCK_thd_data | 33575372 |
- | wait/io/file/myisam/dfile | 21408329 |
- | wait/synch/mutex/myisam/MYISAM_SHARE::intern_lock | 14564146 |
- | wait/synch/mutex/mysys/THR_LOCK::mutex | 14564136 |
- | wait/synch/rwlock/myisam/MYISAM_SHARE::key_root_lock | 6988215 |
- | wait/synch/mutex/innodb/mutex_list_mutex | 8359 |
- | wait/synch/mutex/innodb/rw_lock_list_mutex | 8272 |
- | wait/synch/mutex/innodb/buf_pool_mutex | 1449 |
- | wait/synch/mutex/innodb/log_sys_mutex | 1432 |
- +------------------------------------------------------+------------+
- 10 rows in set (0.00 sec)
- INNODB - HANDLER login READ \`PRIMARY\`=(10000)
- best concurency at 6
- | Handler_read_key | 63002 |
- mysql [localhost] {msandbox} (performance_schema) > SELECT EVENT_NAME, COUNT_STAR FROM events_waits_summary_global_by_event_name ORDER BY COUNT_STAR DESC LIMIT 10;
- +-----------------------------------------------+------------+
- | EVENT_NAME | COUNT_STAR |
- +-----------------------------------------------+------------+
- | wait/synch/mutex/sql/THD::LOCK_thd_data | 11442504 |
- | wait/synch/mutex/innodb/kernel_mutex | 6971775 |
- | wait/synch/mutex/mysys/THR_LOCK::mutex | 4647757 |
- | wait/synch/rwlock/innodb/btr_search_latch | 2323685 |
- | wait/synch/mutex/innodb/mutex_list_mutex | 16560 |
- | wait/synch/mutex/innodb/rw_lock_list_mutex | 16465 |
- | wait/synch/mutex/innodb/buf_pool_mutex | 12409 |
- | wait/synch/mutex/innodb/log_sys_mutex | 10099 |
- | wait/synch/mutex/innodb/log_flush_order_mutex | 9089 |
- | wait/synch/mutex/innodb/rseg_mutex | 2829 |
- +-----------------------------------------------+------------+
- +--------------------+----------+
- | Status | Duration |
- +--------------------+----------+
- | starting | 0.000045 |
- | System lock | 0.000072 |
- | query end | 0.000005 |
- | closing tables | 0.000004 |
- | freeing items | 0.000012 |
- | logging slow query | 0.000004 |
- | cleaning up | 0.000003 |
- +--------------------+----------+
- MariaDB 5.3 MYISAM
- Variable_name | Value |
- +------------------------------------+-----------+
- | Bytes_sent | 9930181 |
- | Com_ha_read | 32431 |
- | Com_show_status | 1 |
- | Created_tmp_tables | 1 |
- | Handler_read_key | 32431 |
- | Handler_read_rnd_next | 258 |
- | Handler_write | 257 |
- | Key_read_requests | 129709 |
- Benchmark
- Average number of seconds to run all queries: 318.000 seconds
- Minimum number of seconds to run all queries: 318.000 seconds
- Maximum number of seconds to run all queries: 318.000 seconds
- Number of clients running queries: 6
- Average number of queries per client: 1666666
- real 5m19.724s
- user 3m13.044s
- sys 3m1.775s
- mysql [localhost] {stephane} (test) > show profile for query 1;
- +--------------------+----------+
- | Status | Duration |
- +--------------------+----------+
- | starting | 0.000043 |
- | System lock | 0.000006 |
- | Table lock | 0.000061 |
- | query end | 0.000005 |
- | freeing items | 0.000012 |
- | logging slow query | 0.000003 |
- | cleaning up | 0.000004 |
- +--------------------+----------+
- Handler socket on MariaDB 5.3 and 5.2
- home/stephane/5.3/sql/handler.h:1807: error: ‘virtual int handler::index_read_map(uchar*, const uchar*, key_part_map, ha_rkey_function)’ is protected
- database.cpp:688: error: within this context
- /home/stephane/5.3/sql/handler.h:1823: error: ‘virtual int handler::index_prev(uchar*)’ is protected
- database.cpp:693: error: within this context
- /home/stephane/5.3/sql/handler.h:1821: error: ‘virtual int handler::index_next(uchar*)’ is protected
- database.cpp:697: error: within this context
- /home/stephane/5.3/sql/handler.h:1829: error: ‘virtual int handler::index_next_same(uchar*, const uchar*, uint)’ is protected
- database.cpp:700: error: within this context
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement