Welcome! Log In Create A New Profile

Advanced

php-fpm and keep-alive

Posted by m4g1c14n 
php-fpm and keep-alive
October 06, 2011 04:27AM
How to enable keep-alive on php-fpm request ??
All settings from nginx.conf and default.conf is not changed, exactly the same for php-fpm.conf and php.ini. (Currently I am still tweaking this server's settings)

I have 2 file, a test.txt (containing 'hello world!') and test.php (containing echo 'hello world!')
The following are 2 ab test on this 2 files

ab -n 100000 -c 512 -k http://v3.ikt-global.com/test.txt
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 v3.ikt-global.com (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests


Server Software: nginx/1.0.8
Server Hostname: v3.ikt-global.com
Server Port: 80

Document Path: /test.txt
Document Length: 13 bytes

Concurrency Level: 512
Time taken for tests: 0.841 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 99343
Total transferred: 22814717 bytes
HTML transferred: 1301027 bytes
Requests per second: 118942.41 [#/sec] (mean)
Time per request: 4.305 [ms] (mean)
Time per request: 0.008 [ms] (mean, across all concurrent requests)
Transfer rate: 26500.37 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 9
Processing: 0 4 11.1 0 155
Waiting: 0 4 11.1 0 155
Total: 0 4 11.4 0 162

Percentage of the requests served within a certain time (ms)
50% 0
66% 2
75% 6
80% 8
90% 12
95% 16
98% 21
99% 28
100% 162 (longest request)

ab -n 100000 -c 512 -k http://v3.ikt-global.com/test.php
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 v3.ikt-global.com (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests


Server Software: nginx/1.0.8
Server Hostname: v3.ikt-global.com
Server Port: 80

Document Path: /test.php
Document Length: 12 bytes

Concurrency Level: 512
Time taken for tests: 4.223 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 15800000 bytes
HTML transferred: 1200000 bytes
Requests per second: 23681.70 [#/sec] (mean)
Time per request: 21.620 [ms] (mean)
Time per request: 0.042 [ms] (mean, across all concurrent requests)
Transfer rate: 3654.01 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 5 2.8 5 12
Processing: 6 16 3.6 16 33
Waiting: 4 15 4.2 14 33
Total: 14 22 2.4 22 33

Percentage of the requests served within a certain time (ms)
50% 22
66% 22
75% 23
80% 23
90% 24
95% 25
98% 27
99% 28
100% 33 (longest request)

You can see that the Keep-Alive requests for test.php is 0 :( , how to enable this?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready