Query Admin
System Administration Tips, Security, Internet
Skip to content
500 Million hits/day with Nginx + PHP-FPM + MySQL
I have recently registered to blitz.io, a very interested cloud service which allows users to stress-test a web server simulating up to 50K concurrent connections, with the possibility to specify different regions to originate requests, the HTTP method, the timeout and much more. This service can help to properly configure the web server (Nginx, Lighttpd, etc), the PHP-FPM and the MySQL to handle as more concurrent connections as possible.
I wanted to test how many concurrent connections Nginx + PHP-FPM + MySQL (Percona) could handle in one dedicated server and the results are very promising as the server handled more than 10,000 concurrent connections with an average CPU usage of 50% / 65%.
The dedicated server has the following hardware specs: Intel Xeon E3 1230v3 (4 cores 8 threads at 3.3 GHz), 32 GB DDR3 ECC, 120 GB SSD, 300 Mbit/s Bandwidth. The Nginx version used is 1.4.5-stable, the MySQL (Percona Server) version used is 5.6.15-63.0 and the PHP-FPM version used is PHP 5.5.9-1~dotdeb.1 (fpm-fcgi).
The test involved the GET request of a remote PHP web page (/test.php?item=testing-12444) used to query the MySQL database with a table of more than 100K rows and print the found row’s items in a HTML web page. So we have not tested the serving of a static file but a PHP page used to display dynamic content.
The following parameters were used in the Blitz rush test:
This is a screenshot of the Nginx status page showing active connections:
This is a screenshot of the output generated by the “top” command:
This is a screenshot of the PHP-FPM status page:
Now lets see how I have configured Nginx, PHP-FPM, MySQL and Sysctl.conf file.
/etc/nginx/nginx.conf:
|
/etc/nginx/fastcgi_params:
|
/etc/php5/fpm/pool.d/www.conf:
|
/etc/sysctl.conf:
|
/etc/mysql/my.cnf:
|
Finally, this is the screenshot of the Blitz rush test results:
As you can see, the test generated 344,447 successful hits in 60.00 seconds and it transferred 3.39 GB of data in and out of our PHP web page (that involved queries to our database of 100K rows). The average hit rate of 5,740.78/second translates to about 496,003,680 hits/day.
This is a screenshot of the hit rate graph:
This is a screenshot of the responses time:
Contact me if you have any questions.
Stay Updated
Other Posts
Random Posts
This entry was posted in Nginx and tagged blitz io test, blitz site test, concurrent connections, nginx benchmark, nginx concurrent connections on February 23, 2014.
Post navigation
← Fix the Nginx 504 gateway timeout Free world flags icon sets →
Search for:
Categories
Apache (8)
Free Icons (1)
Htaccess (6)
Lighttpd (9)
Linux (55)
Microsoft Windows (12)
MySQL (21)
Nginx (19)
Raspberry Pi (7)
Uncategorized (18)
WordPress (21)
Recent Posts
Fixed height and vertical scrollbar on SyntaxHighlighter Evolved
Organize uploads folder by Post ID, Slug, Author, Media Type