Server Software: nginx
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 39 bytes
Concurrency Level: 10
Time taken for tests: 9.064 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 218000 bytes
HTML transferred: 39000 bytes
Requests per second: 110.33 [#/sec] (mean)
Time per request: 90.637 [ms] (mean)
Time per request: 9.064 [ms] (mean, across all concurrent requests)
Transfer rate: 23.49 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 15 90 37.8 87 217
Waiting: 15 90 37.8 87 217
Total: 15 90 37.8 88 217
Swoole 搭配 ThinkPHP 5.0.21
Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 9501
Document Path: /
Document Length: 39 bytes
Concurrency Level: 10
Time taken for tests: 4.355 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 1870000 bytes
HTML transferred: 390000 bytes
Requests per second: 2296.38 [#/sec] (mean)
Time per request: 4.355 [ms] (mean)
Time per request: 0.435 [ms] (mean, across all concurrent requests)
Transfer rate: 419.36 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 6
Processing: 1 4 3.7 4 166
Waiting: 0 4 3.6 3 166
Total: 1 4 3.7 4 166
wget http://pecl.php.net/get/memcache-3.0.8.tgz
tar zxvf memcache-3.0.8.tgz
cd memcache-3.0.8
/usr/local/php5/bin/phpize
./configure --with-php-config=/usr/local/php5/bin/php-config
make
make install
ERROR: failed to open configuration file '/private/etc/php-fpm.conf': No such file or directory (2)
ERROR: failed to load configuration file '/private/etc/php-fpm.conf'
ERROR: FPM initialization failed
WARNING: Nothing matches the include pattern '/private/etc/php-fpm.d/*.conf' from /private/etc/php-fpm.conf at line 125.
ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)
ERROR: failed to post process the configuration
ERROR: FPM initialization failed
WARNING 找不到配置文件夹
cd /private/etc/php-fpm.d
sudo cp www.conf.default www.conf
vim /private/etc/php-fpm.conf,将 error_log 配置为 /usr/local/var/log/php-fpm.log
再次执行 php-fpm 依然报错
NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
sudo php-fpm,再次报错:
ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (48)
ERROR: FPM initialization failed
Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 9501
Document Path: /
Document Length: 39 bytes
Concurrency Level: 10
Time taken for tests: 2.378 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 1870000 bytes
HTML transferred: 390000 bytes
Requests per second: 4204.38 [#/sec] (mean)
Time per request: 2.378 [ms] (mean)
Time per request: 0.238 [ms] (mean, across all concurrent requests)
Transfer rate: 767.79 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 1 2 1.2 2 21
Waiting: 1 2 1.1 2 21
Total: 1 2 1.1 2 21
与原生 ThinkPHP 对比
Server Software: nginx/1.15.3
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /index.php
Document Length: 39 bytes
Concurrency Level: 10
Time taken for tests: 48.468 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 2020000 bytes
HTML transferred: 390000 bytes
Requests per second: 206.32 [#/sec] (mean)
Time per request: 48.468 [ms] (mean)
Time per request: 4.847 [ms] (mean, across all concurrent requests)
Transfer rate: 40.70 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 75.8 0 3611
Processing: 9 45 73.4 42 3651
Waiting: 9 45 73.4 42 3651
Total: 9 47 105.2 42 3651
原生 PHP 输出 hello world
Server Software: nginx/1.15.3
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /hello_world.php
Document Length: 11 bytes
Concurrency Level: 10
Time taken for tests: 0.870 seconds
Complete requests: 5000
Failed requests: 0
Total transferred: 870000 bytes
HTML transferred: 55000 bytes
Requests per second: 5749.02 [#/sec] (mean)
Time per request: 1.739 [ms] (mean)
Time per request: 0.174 [ms] (mean, across all concurrent requests)
Transfer rate: 976.88 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 1 2 0.5 1 5
Waiting: 1 1 0.4 1 4
Total: 1 2 0.5 2 5