Author Topic: PHP-FPM Integration  (Read 14033 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
PHP-FPM Integration
« on: September 10, 2017, 07:55:00 AM »
Hello Folks,

I do some tests. Installed 2 Virtual KVM Servers with Red Hat Enterprise Linux Server release 7.4 (Maipo).

server1: RHEL 7.4, CentOS WebPanel, PHP 7.0.20, MariaDB, Apache 2.4.6

server2: RHEL 7.4, ISPConfig, PHP FPM 7.1.8, MariaDB, Apache 2.4.6 & Varnish Cache & Nginx Reverse Proxy

And server2 with PHP-FPM works faster at the same website which is based on wordpress.

Here are some results from apache bench:

server1: CentOS WebPanel, PHP 7.0.20
Server Software:        CentOS
Server Hostname:        XXXXX
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

Document Path:          /
Document Length:        43234 bytes

Concurrency Level:      10
Time taken for tests:   43.213 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      4354000 bytes
HTML transferred:       4323400 bytes
Requests per second:    2.31 [#/sec] (mean)
Time per request:       4321.343 [ms] (mean)
Time per request:       432.134 [ms] (mean, across all concurrent requests)
Transfer rate:          98.39 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        9   29  16.2     26     111
Processing:   932 4171 656.1   4158    6073
Waiting:      569 3682 605.1   3654    5585
Total:        943 4200 661.2   4184    6108

Percentage of the requests served within a certain time (ms)
  50%   4184
  66%   4319
  75%   4400
  80%   4632
  90%   4844
  95%   5120
  98%   6062
  99%   6108
 100%   6108 (longest request)
server2: ISPConfig, PHP-FPM 7.1.8
Server Software:        Apache/2.4.6
Server Hostname:        XXXXX
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

Document Path:          /
Document Length:        43247 bytes

Concurrency Level:      10
Time taken for tests:   6.636 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      4362700 bytes
HTML transferred:       4324700 bytes
Requests per second:    15.07 [#/sec] (mean)
Time per request:       663.595 [ms] (mean)
Time per request:       66.359 [ms] (mean, across all concurrent requests)
Transfer rate:          642.03 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        8   26  13.1     24      64
Processing:    93  613 195.9    617    1160
Waiting:       71  522 170.8    514    1052
Total:        104  640 194.4    640    1169

Percentage of the requests served within a certain time (ms)
  50%    640
  66%    696
  75%    725
  80%    775
  90%    865
  95%   1003
  98%   1163
  99%   1169
 100%   1169 (longest request)


Without PHP-FPM


With PHP-FPM


It seems website is more faster with PHP-FPM.

Offline
*
Re: PHP-FPM Integration
« Reply #1 on: September 10, 2017, 09:08:30 AM »
Sorry, one correction beacause I cannot modify my post:

server1: RHEL 7.4, CentOS WebPanel, PHP 7.0.20, MariaDB, Apache 2.4.6 & Varnish Cache & Nginx Reverse Proxy

server2: RHEL 7.4, ISPConfig, PHP FPM 7.1.8, MariaDB, Apache 2.4.6

Offline
*
Re: PHP-FPM Integration
« Reply #2 on: September 11, 2017, 12:08:21 PM »
I have a question, why did you used different version of php for testing and have you configured varnish for your site before ?
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: PHP-FPM Integration
« Reply #3 on: September 12, 2017, 06:51:14 AM »
Okay, I will make test with the same versions, but all we know that the php-fpm is faster. Also Varnish and Nginx proxy reverse doesn't matter at this time, because I make tests on port 443 which is https:// and this port is listen directly by Apache:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      27658/varnishd     
tcp        0      0 192.168.1.102:82        0.0.0.0:*               LISTEN      17213/nginx: master
tcp        0      0 127.0.0.1:6082          0.0.0.0:*               LISTEN      27658/varnishd     
tcp6       0      0 :::80                   :::*                    LISTEN      27658/varnishd     
tcp6       0      0 :::8181                 :::*                    LISTEN      31255/httpd         
tcp6       0      0 :::443                  :::*                    LISTEN      31255/httpd         

Offline
*
Re: PHP-FPM Integration
« Reply #4 on: September 13, 2017, 08:31:25 AM »
then apache and php-cgi managed by suphp as handler where only on the cwp server.

Note that suphp is used with shared hosting servers as higher security level, other setups are less secure and they are for servers running only one site as in case of running more sites one hacked site will give a hacker access to the  all other sites more easy.

Since CWP is designed for shared hosting servers I like more to have higher security, however for those having only 1-2 sites on the server they probably want to have some higher performances and that should be as additional option...this will probably come soon as now new CWP was released.
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.