Open Source Databases on Big Machines: Disk Speed and innodb_io_capacity

In this blog post, I’ll look for the bottleneck that prevented the performance in my previous post from achieving better results.

The powerful machine I used in the tests in my previous post has a comparatively slow disk, and therefore I expected my tests would hit a point when I couldn’t increase performance further due to the disk speed.

Hardware configuration:

Processors: physical = 4, cores = 72, virtual = 144, hyperthreading = yes
Memory: 3.0T
Disk speed: about 3K IOPS
OS: CentOS 7.1.1503
File system: XFS

Versions tested and configuration: same as in the first post of this series (check the post for specifics).

Even though I expected my tests would stop increasing in performance due to the disk speed, I did not observe high IO rates in the  iostat output. I already tested with a full data set that fits in memory. In this case, write performance only affected data flushes and log writes. But we should still see a visible decrease in speed. So I decided to try RW tests totally in memory. I created a ramdisk and put the MySQL datadir on it. Surprisingly, results on the SSD and ramdisk did not differ.

I asked my colleagues from “Postgres Professional” to test PostgreSQL with the ramdisk. They got similar results:

It’s interesting that the value of innodb_io_capacity does not have any effect on this situation. Data for the graph below was taken when I ran tests on ramdisk. I wanted to see if I could control the IO activity of a disk, which is extremely fast by default, using this variable.

This totally contradicts all my past experiences with smaller machines. Percona re-purposed the machine with a faster disk (which I used before, described in this post), so I used a similar one with slower disk speed.

Hardware configuration:

Processors: physical = 2, cores = 12, virtual = 24, hyperthreading = yes
Memory: 47.2G
Disk speed: about 3K IOPS
OS: Ubuntu 14.04.5 LTS (trusty)
File system: ext4

Again, in this case innodb_io_capacity benchmarks with a smaller number of CPU cores showed more predictable results.


Both MySQL and PostgreSQL on a machine with a large number of CPU cores hit CPU resources limits before disk speed can start affecting performance. We only tested one scenario, however. With other scenarios, the results might be different.












Share this post

Comments (10)

  • Abbas Ahmed

    Sveta, this is a very interesting observation indeed. However, I was hoping that you would have kept using the same filesystem in both scenarios, any reasons for not keeping it the same? If they were actually different, do we risk this comparison becoming a filesystem benchmark?

    March 1, 2017 at 9:48 pm
    • Sveta Smirnova

      Do you mean Percona and Freematiq machines? I did not try to compare them. But Percona machines are more like those which I see when work on Support issues and they demonstrate behavior I used to. So I use them as a baseline and to check if I am not doing something wrong with the test itself.

      This is certainly not filesystem benchmark, because workload is not disk-bound by its nature. Still I expected I would hit disk performance issues on Freematiq machine at some point and I did not.

      March 2, 2017 at 5:23 am
  • Holger Thiel

    The filesystem is different.

    March 2, 2017 at 4:23 am
    • Sveta Smirnova

      Yes, but I am not comparing filesystems or even Freematiq and Percona machine. I used smaller machine to show behavior which I expect based on my Support experience. See more detailed reply to the previous comment.

      March 2, 2017 at 5:26 am
  • Jouni Järvinen

    If hundreds or thousands of queries faster speed ain’t worth minding, what is ?

    March 2, 2017 at 8:24 am
  • Mark Callaghan

    Did you get PMP output to see where the CPU/mutex bottlenecks occur?

    March 2, 2017 at 3:08 pm
    • Sveta Smirnova

      And first lines of PMP:

      $ head -n 10 pt-pmp.log.20170303
      Пт мар 3 10:51:09 UTC 2017
      29 pthread_cond_wait,wait(,os_event::wait_low(,sync_array_wait_event(,TTASEventMutex::wait(ut0mutex.ic:89),spin_and_try_lock(ib0mutex.h:850),enter(ib0mutex.h:850),PolicyMutex(ib0mutex.h:850),lock_table(,row_search_mvcc(,ha_innobase::index_read(,handler::ha_index_read_map(,handler::read_range_first(,handler::multi_range_read_next(,DsMrr_impl::dsmrr_next(,QUICK_RANGE_SELECT::get_next(,rr_quick(,mysql_update(,Sql_cmd_update::try_single_table_update(,Sql_cmd_update::execute(,mysql_execute_command(,Prepared_statement::execute(,Prepared_statement::execute_loop(,mysqld_stmt_execute(,dispatch_command(,do_command(,handle_connection(,pfs_spawn_thread(,start_thread(,clone(
      28 pthread_cond_wait,native_cond_wait(thr_cond.h:140),my_cond_wait(thr_cond.h:140),inline_mysql_cond_wait(thr_cond.h:140),Per_thread_connection_handler::block_until_new_connection(thr_cond.h:140),handle_connection(,pfs_spawn_thread(,start_thread(,clone(
      20 pthread_cond_wait,wait(,os_event::wait_low(,sync_array_wait_event(,TTASEventMutex::wait(ut0mutex.ic:89),spin_and_try_lock(ib0mutex.h:850),enter(ib0mutex.h:850),PolicyMutex(ib0mutex.h:850),log_write_up_to(,trx_flush_log_if_needed_low(,trx_flush_log_if_needed(,trx_commit_complete_for_mysql(,innobase_commit(,ha_commit_low(,TC_LOG_DUMMY::commit(,ha_commit_trans(,trans_commit(,mysql_execute_command(,mysql_parse(,dispatch_command(,do_command(,handle_connection(,pfs_spawn_thread(,start_thread(,clone(
      10 __io_getevents_0_4(,LinuxAIOHandler::collect(,LinuxAIOHandler::poll(,os_aio_linux_handler(,os_aio_handler(,fil_aio_wait(,io_handler_thread(,start_thread(,clone(
      4 pthread_cond_wait,wait(,os_event::wait_low(,sync_array_wait_event(,TTASEventMutex::wait(ut0mutex.ic:89),spin_and_try_lock(ib0mutex.h:850),enter(ib0mutex.h:850),PolicyMutex(ib0mutex.h:850),lock_clust_rec_read_check_and_lock(,sel_set_rec_lock(,row_search_mvcc(,ha_innobase::index_read(,handler::ha_index_read_map(,handler::read_range_first(,handler::multi_range_read_next(,DsMrr_impl::dsmrr_next(,QUICK_RANGE_SELECT::get_next(,rr_quick(,mysql_update(,Sql_cmd_update::try_single_table_update(,Sql_cmd_update::execute(,mysql_execute_command(,Prepared_statement::execute(,Prepared_statement::execute_loop(,mysqld_stmt_execute(,dispatch_command(,do_command(,handle_connection(,pfs_spawn_thread(,start_thread(,clone(
      3 pthread_cond_wait,wait(,os_event::wait_low(,sync_array_wait_event(,TTASEventMutex::wait(ut0mutex.ic:89),spin_and_try_lock(ib0mutex.h:850),enter(ib0mutex.h:850),PolicyMutex(ib0mutex.h:850),lock_sec_rec_modify_check_and_lock(,btr_cur_del_mark_set_sec_rec(,row_upd_sec_index_entry(,row_upd_sec_step(,row_upd(,row_upd_step(,row_update_for_mysql_using_upd_graph(,row_update_for_mysql(,ha_innobase::delete_row(,handler::ha_delete_row(,Sql_cmd_delete::mysql_delete(,Sql_cmd_delete::execute(,mysql_execute_command(,Prepared_statement::execute(,Prepared_statement::execute_loop(,mysqld_stmt_execute(,dispatch_command(,do_command(,handle_connection(,pfs_spawn_thread(,start_thread(,clone(
      3 pthread_cond_wait,wait(,os_event::wait_low(,buf_flush_page_cleaner_worker(,start_thread(,clone(
      2 pthread_cond_wait,wait(,os_event::wait_low(,sync_array_wait_event(,TTASEventMutex::wait(ut0mutex.ic:89),spin_and_try_lock(ib0mutex.h:850),enter(ib0mutex.h:850),PolicyMutex(ib0mutex.h:850),lock_update_delete(,btr_cur_optimistic_delete_func(,row_purge_remove_sec_if_poss_leaf(,row_purge_remove_sec_if_poss(,row_purge_upd_exist_or_extern_func(,row_purge_record_func(,row_purge(,row_purge_step(,que_thr_step(,que_run_threads_low(,que_run_threads(,srv_task_execute(,srv_worker_thread(,start_thread(,clone(
      2 pthread_cond_wait,wait(,os_event::wait_low(,sync_array_wait_event(,TTASEventMutex::wait(ut0mutex.ic:89),spin_and_try_lock(ib0mutex.h:850),enter(ib0mutex.h:850),PolicyMutex(ib0mutex.h:850),lock_sec_rec_modify_check_and_lock(,btr_cur_del_mark_set_sec_rec(,row_upd_sec_index_entry(,row_upd_sec_step(,row_upd(,row_upd_step(,row_update_for_mysql_using_upd_graph(,row_update_for_mysql(,ha_innobase::update_row(,handler::ha_update_row(,mysql_update(,Sql_cmd_update::try_single_table_update(,Sql_cmd_update::execute(,mysql_execute_command(,Prepared_statement::execute(,Prepared_statement::execute_loop(,mysqld_stmt_execute(,dispatch_command(,do_command(,handle_connection(,pfs_spawn_thread(,start_thread(,clone(

      March 3, 2017 at 6:50 am
      • cyberjots

        Sveta, I wonder if Percona Server was launched with numactl –interleave ALL for both cases? We could be getting cache lines thrashed in the bigger box if memory policy is on defaults.

        Also, does the above profiler output belong to the bigger box?

        March 3, 2017 at 11:16 am
  • Sveta Smirnova

    Here is perf top output:

    2,42% [.] __memmove_ssse3_back
    2,36% mysqld [.] rec_get_offsets_func
    2,24% mysqld [.] buf_page_get_gen
    1,70% mysqld [.] row_search_mvcc
    1,57% [kernel] [k] call_function_interrupt
    1,35% mysqld [.] ut_delay

    March 3, 2017 at 6:49 am

Comments are closed.

Use Percona's Technical Forum to ask any follow-up questions on this blog topic.