Archive for the “PHP” Category

So this is a simple change that will apply to php and not really to the web service. I took this from an apache tip page. So if you curl your page’s headers you should see your version of php listed as “X-Powered-By”

neoproxy@apex[~]$ curl -I 8bitpipe.com
HTTP/1.1 200 OK
Date: Thu, 28 Feb 2013 15:11:02 GMT
Server: nginx
Connection: Keep-Alive
X-Pingback: http://8bitpipe.com/xmlrpc.php
Content-Type: text/html; charset=UTF-8
X-Powered-By: PHP/5.3.3

To turn this off, go into php.ini and find expose_php and change it to off. This is on by default so if you can’t find it, add the following in the [php] section:

expose_php = Off

Afterwards you will need to restart php-cgi, php-fpm, or apache, depending on what you’re using. Then when you check the headers:

neoproxy@apex[~]$ curl -I 8bitpipe.com
HTTP/1.1 200 OK
Date: Thu, 28 Feb 2013 15:17:34 GMT
Server: nginx
Connection: Keep-Alive
X-Pingback: http://8bitpipe.com/xmlrpc.php
Content-Type: text/html; charset=UTF-8

  • http://www.ducea.com/2006/06/16/apache-tips-tricks-hide-php-version-x-powered-by/
  • http://www.php.net/manual/en/ini.core.php#ini.expose-php

Comments No Comments »

I install APC for customers all the time, but never benchmarked any specific performance test. I have seen the effect and would suggest some sort of caching service for a website. Well, I noticed I didn’t have APC on my server, so I thought I would do some bench marking and install. Here is the results of using apache’s benchmark command against my nginx server:

Before APC

Server Software: nginx/0.8.54
Server Hostname: 8bitpipe.com
Server Port: 80

Document Path: /
Document Length: 41342 bytes

Concurrency Level: 50
Time taken for tests: 111.764 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 41643000 bytes
HTML transferred: 41342000 bytes
Requests per second: 8.95 [#/sec] (mean)
Time per request: 5588.215 [ms] (mean)
Time per request: 111.764 [ms] (mean, across all concurrent requests)
Transfer rate: 363.86 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.0 1 7
Processing: 687 5455 743.2 5424 7066
Waiting: 683 5451 743.2 5420 7063
Total: 693 5456 742.5 5425 7067

Percentage of the requests served within a certain time (ms)
50% 5425
66% 5559
75% 5728
80% 5855
90% 6260
95% 6459
98% 6595
99% 6680
100% 7067 (longest request)

After APC

Server Software: nginx/0.8.54
Server Hostname: 8bitpipe.com
Server Port: 80

Document Path: /
Document Length: 41342 bytes

Concurrency Level: 50
Time taken for tests: 78.133 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 41643000 bytes
HTML transferred: 41342000 bytes
Requests per second: 12.80 [#/sec] (mean)
Time per request: 3906.663 [ms] (mean)
Time per request: 78.133 [ms] (mean, across all concurrent requests)
Transfer rate: 520.48 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.5 1 4
Processing: 555 3816 623.6 3727 5867
Waiting: 551 3812 623.7 3722 5863
Total: 559 3817 623.4 3727 5867

Percentage of the requests served within a certain time (ms)
50% 3727
66% 3833
75% 3977
80% 4084
90% 4462
95% 4894
98% 5546
99% 5635
100% 5867 (longest request)

This is a noticeable difference on this simple test without any tuning to APC (my nginx install is fairly stock also).

Comments No Comments »