Introduction
In this post I will describe how I tested the performance of web servers.
Its goal is to show what are the ways to optimize the performance of a web server, especially in conditions of limited VDS power.
Configurations
All tests are performed on a virtual machine with a configuration of 1 core i5 2400 and 512 RAM.
Debian 6 x86 is used as the OS. Apache 2.2.16, Nginx 1.1.4, eAccelerator 0.9.6.1, PHP 5.3.8, MySQL 5.1.49.
Nginx and Apache are used in almost standard configurations, using the same www folder, the same database. Nginx works through php-fpm. All this is installed pure wordpress. Testing is done using Apache Benchmark, which comes bundled with Apache.
Tested with the command ab -c 5 -n 300, which means 300 times in 5 parallel queries.
The main method of increasing productivity was
eAccelerator .
Tests
')
Apache
RAM occupied: 250-300 MB.
Without accelerator:
Time taken for tests: 54.913 seconds
Requests per second: 5.46 [# / sec] (mean)
Time per request: 915.214 [ms] (mean)
Accelerator:
Time taken for tests: 31.390 seconds
Requests per second: 9.56 [# / sec] (mean)
Time per request: 523.163 [ms] (mean)
Nginx
RAM occupied: 150-250 MB.
Without accelerator:
Time taken for tests: 52.751 seconds
Requests per second: 5.69 [# / sec] (mean)
Time per request: 879.178 [ms] (mean)
Accelerator:
Time taken for tests: 29.111 seconds
Requests per second: 10.31 [# / sec] (mean)
Time per request: 485.183 [ms] (mean)
findings
Based on the tests, I came to the conclusion that Nginx consumes less memory by almost one and a half times and a little faster. The advantage of the accelerator on the face, almost double acceleration, plus even, despite the load, the site responds relatively quickly (500ms). With an increase in the performance of the machine, the increase may be
300-400% , compared to a web server without an accelerator.
UPD: Without load, the same page opens for 100ms with the accelerator and for 200ms without it, which is also a very good increase.