You know from the last post I got a VPS yesterday with 256MB ram.

Yesterday, I configured it with full LEMP (Linux + Nginx / EngineX + MySQL + PHP) stack and install drupal. Blogged some performance test here.

Today I thought do to some more experiments with the box. Actually wasn't happy with the total delivery speed of the webserver.

So thought to do something to speed it up. Along with the decision I went for hunting with the official PHP accelerator APC and varnish. Configured APC without any trouble but stuck with varnish. After doing some Google I cae to know that, varnish caches everything it gets even the error pages. I removed varnish after getting this information as it didn't sound good to me!

Anyway, only with APC I found a huge performance difference. Speed increased more than 5x. Here is the testing result before and after APC.

Before APC

ab -n 1000 -c 10 http://drup.ibabar.com/?q=node/1 This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking drup.ibabar.com (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requests

Server Software: nginx/1.2.4 Server Hostname: drup.ibabar.com Server Port: 80

Document Path: /?q=node/1 Document Length: 8197 bytes

Concurrency Level: 10 Time taken for tests: 118.693 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 8678000 bytes HTML transferred: 8197000 bytes Requests per second: 8.43 #/sec Time per request: 1186.933 ms Time per request: 118.693 ms Transfer rate: 71.40 [Kbytes/sec] received

Connection Times (ms) min mean[+/-sd] median max Connect: 36 37 0.9 37 40 Processing: 220 1146 165.4 1115 1710 Waiting: 183 1097 164.9 1070 1673 Total: 257 1183 165.4 1153 1747

Percentage of the requests served within a certain time (ms) 50% 1153 66% 1249 75% 1300 80% 1340 90% 1401 95% 1455 98% 1534 99% 1593 100% 1747 (longest request)

And after APC

ab -n 1000 -c 10 http://drup.ibabar.com/?q=node/1 This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking drup.ibabar.com (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requests

Server Software: nginx/1.2.4 Server Hostname: drup.ibabar.com Server Port: 80

Document Path: /?q=node/1 Document Length: 8197 bytes

Concurrency Level: 10 Time taken for tests: 21.896 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 8678000 bytes HTML transferred: 8197000 bytes Requests per second: 45.67 #/sec Time per request: 218.957 ms Time per request: 21.896 ms Transfer rate: 387.04 [Kbytes/sec] received

Connection Times (ms) min mean[+/-sd] median max Connect: 9 10 1.2 10 22 Processing: 72 208 42.8 195 312 Waiting: 63 192 42.8 184 299 Total: 83 218 42.7 205 322

Percentage of the requests served within a certain time (ms) 50% 205 66% 210 75% 221 80% 276 90% 288 95% 291 98% 294 99% 296 100% 322 (longest request)

You see, before APC it was handling only 8 requests per second and now the counting is 48. More than 5x. Request time also reduced, longest request was 322ms after APC, not bad huh! And you know everything is only on the 256mb box which I got only for 12 bucks for a year!

Now the final decision is may the be box be big or small, APC is a must.

Oh one more information, I am exploring a new control panel called Ajenti on the box and you know I am liking it. I will share my experience with Ajenti on next posts.

Till now tell me what do you think about PHP Accelerators for speeding up web servers? What's your preferable PHP Accelerators.




What's on your mind?


430 Comments