Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property ACF::$fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields.php on line 138

Deprecated: Creation of dynamic property acf_loop::$loops is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 28

Deprecated: Creation of dynamic property ACF::$loop is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 269

Deprecated: Creation of dynamic property ACF::$revisions is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/revisions.php on line 397

Deprecated: Creation of dynamic property acf_validation::$errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 28

Deprecated: Creation of dynamic property ACF::$validation is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 214

Deprecated: Creation of dynamic property acf_form_customizer::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 28

Deprecated: Creation of dynamic property acf_form_customizer::$preview_fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 29

Deprecated: Creation of dynamic property acf_form_customizer::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 30

Deprecated: Creation of dynamic property ACF::$form_front is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-front.php on line 598

Deprecated: Creation of dynamic property acf_form_widget::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 34

Deprecated: Creation of dynamic property acf_form_widget::$preview_reference is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 35

Deprecated: Creation of dynamic property acf_form_widget::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 36

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the all-in-one-wp-migration domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp_plugin/wp_plugin.php on line 23

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 54

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1539

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 828

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rocket domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property acf_field_oembed::$width is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 31

Deprecated: Creation of dynamic property acf_field_oembed::$height is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 32

Deprecated: Creation of dynamic property acf_field_google_map::$default_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-google-map.php on line 33

Deprecated: Creation of dynamic property acf_field__group::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-group.php on line 31

Deprecated: Creation of dynamic property acf_field_clone::$cloning is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 34

Deprecated: Creation of dynamic property acf_field_clone::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 35

Deprecated: Creation of dynamic property jh_acf_field_table::$settings is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-table-field/class-jh-acf-field-table.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":24964,"date":"2021-11-11T01:49:06","date_gmt":"2021-11-10T23:49:06","guid":{"rendered":"https:\/\/upcloud.com\/community\/tutorials\/benchmark-managed-databases-upcloud"},"modified":"2021-11-11T01:49:06","modified_gmt":"2021-11-10T23:49:06","slug":"benchmark-managed-databases-upcloud","status":"publish","type":"tutorial","link":"https:\/\/studiogo.tech\/upcloudold\/tutorial\/benchmark-managed-databases-upcloud\/","title":{"rendered":"How to benchmark Managed Databases on UpCloud"},"content":{"rendered":"\n

Benchmarking managed database performance without a realistic workload can be difficult. While testing the database specifically for your use case would be ideal, setting up a replica of your production environment for comparison might be prohibitively time-consuming. Luckily, a simpler solution for this purpose exists, sysbench!<\/p>\n\n\n\n

Sysbench is a popular command-line benchmarking tool for testing system and hardware performance. Originally designed to run CPU, memory and I\/O tests, it\u2019s also capable of benchmarking MySQL and PostgreSQL databases by generating synthetic traffic to your database systems.<\/p>\n\n\n\n

It\u2019s great for comparing the performance of different hardware, types of database nodes and even managed database offerings from cloud providers. In this tutorial, we\u2019ll show you how to install the latest version of sysbench, how to generate test data and, of course, how to benchmark Managed Databases on UpCloud.<\/p>\n\n\n\n

Pre-requisitions<\/h2>\n\n\n\n

Start by setting up a new Managed Database cluster<\/a> in a configuration you want to benchmark. If you already have an idea of your needs, choosing a configuration plan matching closest to your existing set-up would be a good starting point.<\/p>\n\n\n\n

\"Creating<\/figure>\n\n\n\n

You will also need to choose the host that will run the benchmarks. Generally, Managed Databases are intended to service Cloud Servers located within the same data centre using the private Utility network exclusive to your UpCloud account. So the next step is to create a new Cloud Server<\/a> for running the sysbench tests. Make sure both are in the same data centre.<\/p>\n\n\n\n

\"Creating<\/figure>\n\n\n\n

Installing sysbench from source<\/h2>\n\n\n\n

Once you\u2019ve created your Managed Database instance and a fresh Cloud Server, continue by login into the server using SSH<\/a>.<\/p>\n\n\n\n

Next, we\u2019ll install sysbench directly from the source. Although sysbench is readily available in most repositories, this version offers often lags behind the development. Therefore going straight for the source ensures you have the latest, most up-to-date version of the tool.<\/p>\n\n\n\n

The main reason, in this case, is to allow us to use the sysbench option --mysql-ssl=REQUIRED<\/tt> to encrypt traffic and accurately simulate real use cases. This option is only available in sysbench version 1.1 and newer.<\/p>\n\n\n\n

To start, install the required packages to build sysbench.<\/p>\n\n\n\n

sudo apt-get install make automake libtool pkg-config libaio-dev libmysqlclient-dev libssl-dev -y<\/pre>\n\n\n\n

Then download the latest version from the sysbench GitHub repository.<\/p>\n\n\n\n

git clone https:\/\/github.com\/akopytov\/sysbench<\/pre>\n\n\n\n

Next, change into the download directory and run the configuration scripts.<\/p>\n\n\n\n

cd sysbench\n.\/autogen.sh\n.\/configure<\/pre>\n\n\n\n

Lastly, build and install sysbench onto your Cloud Server.<\/p>\n\n\n\n

make -j\nmake install<\/pre>\n\n\n\n

Once complete, you can verify that the sysbench was installed successfully by checking for its version number.
sysbench --version
sysbench 1.1.0-ead2689<\/code><\/p>\n\n\n\n

Generating test data<\/h2>\n\n\n\n

With sysbench installed, we can take a look at the included database benchmarking scripts. When installed from the source, the benchmark scripts can be found at the following location.<\/p>\n\n\n\n

ls \/usr\/local\/share\/sysbench\/
\nbulk_insert.lua oltp_delete.lua oltp_point_select.lua oltp_read_write.lua oltp_update_non_index.lua select_random_points.lua oltp_common.lua oltp_insert.lua oltp_read_only.lua oltp_update_index.lua oltp_write_only.lua select_random_ranges.lua<\/code><\/p>\n\n\n\n

These LUA scripts are used to execute OLTP workloads on MySQL databases to simulate real-world use cases. OLTP stands for online transaction processing, which represents typical workloads for online applications such as e-commerce, order entry and financial transaction.<\/p>\n\n\n\n

To start with, we\u2019ll use the oltp_read_only.lua<\/tt> to generate test data in our Managed Database.<\/p>\n\n\n\n

Note that the long commands here include a number of parameters you\u2019ll need to set manually. It\u2019s best to copy the example first into a text editor to fill in your connection details before copying the ready command to your terminal.<\/p>\n\n\n\n

sysbench oltp_read_only
\n--mysql-host=hostname<\/tt>.db.upclouddatabases.com
\n--mysql-user=upadmin --mysql-password=password<\/tt>
\n--mysql-port=11550 --mysql-db=defaultdb
\n--mysql-ssl=REQUIRED --threads=40
\n--tables=40 --table-size=2000000 prepare<\/code><\/p>\n\n\n\n

The above command includes the following parameters:<\/p>\n\n\n\n