Comparison of web server performance using Wordpress as an example

    Introduction


    In this post, I will describe how I tested web server performance.
    Its purpose is to show what are the ways to optimize the performance of the web server, especially in conditions of limited power VDS.

    Configurations


    All tests are performed on a virtual machine with a configuration of 1 core i5 2400 and 512 RAM.
    The OS used is Debian 6 x86. 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, they use the same www folder, the same database. Nginx works through php-fpm. All of this has pure wordpress installed. Testing is done using the 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 for increasing productivity has become 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)

    With 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)

    With accelerator:
    Time taken for tests: 29.111 seconds
    Requests per second: 10.31 [ # / sec] (mean)
    Time per request: 485.183 [ms] (mean)

    conclusions



    Based on the tests, I came to the conclusion that Nginx consumes less memory 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 machine performance, the increase can be 300-400% , compared with a web server without an accelerator.

    UPD: Without load, the same page opens in 100ms with an accelerator and in 200ms without it, which is also a very good increase.

    Also popular now: