{"id":24618,"date":"2015-08-21T09:52:14","date_gmt":"2015-08-21T07:52:14","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=24618"},"modified":"2015-08-21T09:52:14","modified_gmt":"2015-08-21T07:52:14","slug":"wordpress-benchmark-of-mysql-server-on-amazon-ec2","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2015\/08\/21\/wordpress-benchmark-of-mysql-server-on-amazon-ec2\/","title":{"rendered":"WordPress Benchmark of MySQL server on Amazon EC2"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>I have a friend who is a newcomer to the world of WordPress. \u00a0Until recently, he was mostly working with custom-built systems and a PostgreSQL database engine, so there are many topics to cover.<\/p>\n<p>One of the topics that came up today was the performance of the database engine. \u00a0A quick Google search brought up the <a href=\"https:\/\/wordpress.org\/plugins\/benchmark\/\">Benchmark plugin<\/a>, which we used to compare results from several servers. \u00a0(NOTE: you&#8217;ll need php-bcmath installed on your server for this plugin to work.)<\/p>\n<p>My friend&#8217;s test server showed a rather poor 48 requests \/ second result. \u00a0And that&#8217;s on an\u00a0Intel Core2 Duo E4500 machine with 4 GB of RAM and\u00a0160 GB 7200 RPM\u00a0SATA HDD, running Ubuntu 12.04 x86-64.<\/p>\n<p>So, I tried it on my setup. \u00a0My setup is all on <a href=\"https:\/\/aws.amazon.com\/ec2\/\">Amazon EC2<\/a>, using the smallest possible <strong>t2.micro<\/strong> servers (that&#8217;s\u00a0Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz, with 1 GB of RAM and god knows what kind of hard disk, running Amazon AMI).<\/p>\n<p>First, I ran the benchmark on the test server, which hosts about 20 sites with low traffic (I didn&#8217;t want to bring up a separate instance for just a single benchmark run). \u00a0MySQL runs on the same instance as the web server. \u00a0And here are the results:<\/p>\n<table>\n<tbody>\n<tr>\n<th><\/th>\n<th>Your System<\/th>\n<th>Industry Average<\/th>\n<\/tr>\n<tr>\n<th>CPU Speed:<\/th>\n<td>38,825 BogoWips<\/td>\n<td>24,896 BogoWips<\/td>\n<\/tr>\n<tr>\n<th>Network Transfer Speed:<\/th>\n<td>97.81 Mbps<\/td>\n<td>11.11 Mbps<\/td>\n<\/tr>\n<tr>\n<th>Database Queries per Second:<\/th>\n<td>425 Queries\/Sec<\/td>\n<td>1,279 Queries\/Sec<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Secondly, I ran the benchmark on one of the live servers, which also hosts about 20 sites with low traffic. Here though, Nginx web server runs on one instance and the MySQL database on another. Here are the results:<\/p>\n<table>\n<tbody>\n<tr>\n<th><\/th>\n<th>Your System<\/th>\n<th>Industry Average<\/th>\n<\/tr>\n<tr>\n<th>CPU Speed:<\/th>\n<td>37,712 BogoWips<\/td>\n<td>24,901 BogoWips<\/td>\n<\/tr>\n<tr>\n<th>Network Transfer Speed:<\/th>\n<td>133.91 Mbps<\/td>\n<td>11.15 Mbps<\/td>\n<\/tr>\n<tr>\n<th>Database Queries per Second:<\/th>\n<td>1,338 Queries\/Sec<\/td>\n<td>1,279 Queries\/Sec<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In both cases, MySQL is v5.5.42, running on the <em>\/usr\/share\/doc\/mysql55-server-5.5.42\/my-huge.cnf<\/em> configuration file. (I find it ironically pleasing that the tiniest of Amazon EC2 servers fits perfectly for the <strong>huge<\/strong> configuration shipped with documentation.)<\/p>\n<p>The benchmark plugin explains how the numbers are calculated. Here&#8217;s what it says about the database queries:<\/p>\n<blockquote><p>To benchmark your database I use your wp_options table which uses the longtext column type which is the same type used by wp_posts. I do 1000 inserts of 50 paragraphs of text, then 1000 selects, 1000 updates and 1000 deletes. I use the time taken to calculate queries per second based on 4000 queries. This is a good indication of how fast your overall DB performance is in a worst case scenario when nothing is cached.<\/p><\/blockquote>\n<p>So, it&#8217;s a good number to throw around, but it&#8217;s far from the realistic site performance, as your WordPress site will mostly get SELECTs, not INSERTs or UPDATEs or DELETEs. And then, you&#8217;ll obviously need to see how many SQL queries do you need per page. And then you&#8217;ll need to examine all the caching in play &#8211; from browser, web server, WordPress, MySQL, and the operating system. And then, and then, and then.<\/p>\n<p>But for a quick measure, I think, this is a good benchmark. It&#8217;s obvious that my friend can get a lot more out of his server without digging too deep. It&#8217;s obvious that separating web and database server into two Amazon instances gives you quite a boost. And it&#8217;s obvious that I don&#8217;t know much about performance measuring.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>I have a friend who is a newcomer to the world of WordPress. \u00a0Until recently, he was mostly working with custom-built systems and a PostgreSQL database engine, so there are many topics to cover. One of the topics that came up today was the performance of the database engine. \u00a0A quick Google search brought up &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2015\/08\/21\/wordpress-benchmark-of-mysql-server-on-amazon-ec2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">WordPress Benchmark of MySQL server on Amazon EC2<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"WordPress Benchmark of MySQL server on Amazon EC2 #Amazon #aws #MySQL #performance #benchmark","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,133,62,1334],"tags":[3270,3333,1559,3066,1057,2289],"keyring_services":[],"class_list":["post-24618","post","type-post","status-publish","format-standard","hentry","category-general","category-sysadmin","category-technology","category-web-work","tag-amazon-aws","tag-amazon-ec2","tag-databases","tag-mysql","tag-performance","tag-web-hosting"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":23425,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/01\/29\/on-amazon-ec2-instances\/","url_meta":{"origin":24618,"position":0},"title":"On Amazon EC2 instances","author":"Leonid Mamchenkov","date":"January 29, 2015","format":false,"excerpt":"I am staring at the t2.micro (the smallest available instance type) server running MySQL 5.5.40 (using the my-huge.cnf example configuration shipped with MySQL, which ironically matches t2.micro specs). \u00a0Here's why (as reported by Nagios for the last few hours): Queries per second avg: 12888.839 The number is fluctuating between about\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26220,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/07\/01\/amazon-elastic-file-system\/","url_meta":{"origin":24618,"position":1},"title":"Amazon Elastic File System","author":"Leonid Mamchenkov","date":"July 1, 2016","format":false,"excerpt":"Here are some great news from the Amazon AWS blog - the announcement of the Elastic File System (EFS): EFS lets you create POSIX-compliant file systems and attach them to one or more of your EC2 instances via NFS. The file system grows and shrinks as necessary (there\u2019s no fixed\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28472,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/04\/08\/immutable-deployment-quorum\/","url_meta":{"origin":24618,"position":2},"title":"Immutable Deployment @ Quorum","author":"Leonid Mamchenkov","date":"April 8, 2018","format":false,"excerpt":"\"Immutable Deployment @ Quorum\" describes yet another approach to automated, and this case - immutable, deployments.\u00a0 This particular setup is slightly more on the SysAdmin\/DevOps side rather than on the development side, utilizing tools like Ansible, Amazon EC2, and Amazon AMI. If you are building very few projects, or projects\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/04\/deployment-500x215.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":24022,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/04\/30\/amazon-efs-preview\/","url_meta":{"origin":24618,"position":3},"title":"Amazon EFS preview","author":"Leonid Mamchenkov","date":"April 30, 2015","format":false,"excerpt":"Amazon Elastic File System, or EFS for short, is the missing piece of the cloud puzzle. \u00a0With all those EC2 instances, elastic load balances and IAM roles, one would often need a shared file system. \u00a0Until now, you'd either be using either an S3-based solution, which scales well in terms\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"Amazon EFS","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2015\/04\/pdp_banner_efs-500x88.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":22435,"url":"https:\/\/mamchenkov.net\/wordpress\/2014\/08\/26\/aws-name-server-dns-server-that-lets-you-look-up-ec2-instances-by-instance-name\/","url_meta":{"origin":24618,"position":4},"title":"aws-name-server &#8211; DNS server that lets you look up ec2 instances by instance name","author":"Leonid Mamchenkov","date":"August 26, 2014","format":"link","excerpt":"aws-name-server - DNS server that lets you look up ec2 instances by instance name","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25199,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/02\/25\/upgrading-amazon-ec2-instance-type\/","url_meta":{"origin":24618,"position":5},"title":"Upgrading Amazon EC2 instance type","author":"Leonid Mamchenkov","date":"February 25, 2016","format":false,"excerpt":"By now everybody knows that one of the major benefits to using cloud services rather than hosting on your own hardware is the ease to scale quickly. \u00a0Many web applications and large companies benefit from this, but what about smaller customers? \u00a0How about a single server? Well, today one of\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/24618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=24618"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/24618\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=24618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=24618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=24618"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=24618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}