You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Hajo Locke <Ha...@gmx.de> on 2018/01/22 12:06:45 UTC

[users@httpd] h2load http/2 benchmarkingresults using different mpm/php configurations

Hello List,

separatly from other mail with proxy_fcgi/enablereuse problem i want to 
tell about my results. This is quite interesting.
System is Ubuntu16.04, libnghttp2-14 1.7.1, Apache 2.4.29, php 7.0.25

All tests were startet with this params: h2load  -n100000 -c100 -m10 
https://example.com/infophp.php
Tests used for this example were 100% successful:
requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 
failed, 0 errored, 0 timeout
I run 10 Tests for every configuration, i just write here one 
significant result as example.

First test is mod_php with mpm_prefork
finished in 42.87s, 2332.39 req/s, 253.63MB/s load average: 47,69

2nd test is php-fpm with classic mod_fastcgi configuration using 
FastCGIExternalServer
finished in 51.28s, 1950.25 req/s, 227.16MB/s load average: 60,70

3rd test is php-fpm using fcgi_proxy configuration 
(unixsocket/enablereuse=off) and mpm_event
finished in 47.54s, 2103.41 req/s, 225.35MB/s load average: 61,50

I expected that fcgi_proxy/mpm_event is quicker then mod_fastcgi, but i 
never expected that my winner in this test is mod_php. also there was 
lowest loadavg.
This is especially remarkable because i use unofficial patch to activate 
http2 with mpm prefork along with "H2MaxWorkers 1" to avoid segfaults.
Version 2.4.27 dropped support for http2 when using mpm_prefork through 
performance-probs reported by users.
http://httpd.markmail.org/search/?q=Apache%20HTTP%20Server%202.4.27%20Released#query:Apache%20HTTP%20Server%202.4.27%20Released+page:1+mid:nsnewcr74hg6527f+state:results

I wonder why my test showed this result. May be mass-requesting of 
phpinfo is not comparable with a real production-server but altogether 
iam surprised.
How to understand this result ?

Thanks,
Hajo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] h2load http/2 benchmarkingresults using different mpm/php configurations

Posted by Stefan Eissing <st...@greenbytes.de>.
Hi Hajo,

on my dev machine I get for static files using mpm_event on 
Ubuntu 16.04 Parallels image, current 2.4.x Apache with

> h2load  -n100000 -c100 -m10 https://test.example.org:12346/XXX

with XXX being
 2005 bytes: finished in 1.96s, 51060.63 req/s, 100.20MB/s
10844 bytes: finished in 2.22s, 45013.66 req/s, 467.93MB/s
10MBytes:    finished in 44.07s, 226.89 req/s, 2.11GB/s
(using -n10000, since I was impatient)

So, you can see the difference with overheads and raw
transfer speeds. Now, this is a machine from summer last
year. If I run the same on a 5 year old quad core Intel,
I get roughly 25k-30k req/s for small files and max ~1.4 GB/s
on large file throughput.

Now, is that relevant? Are your tests more relevant?

That depends on how a site works?

If you assume a site with 1 php that drags in 10-30
images, css and fonts, that will be one thing. If
you server static resources somewhere else and serve
only php, it's another.

And there are lots of other factors that may become
important here. So, I personally find the difference
in your numbers between 2332 req/s and 2103 req/s not
that relevant for the advantage to serve more than
one request per process. But there might be a use
case where it is super relevant.

Also, if you want a client to benefit from HTTP/2, the
mpm_prefork with "H2Worker 1" setting will give a client
the same performance and timing as a single(!) HTTP/1.1
connection. 

Such a setup would cripple a modern browser. Sure, the
server numbers such a requests/sec look great, but the
page load times will not.

Makes sense?

Cheers,

Stefan




> Am 22.01.2018 um 13:06 schrieb Hajo Locke <Ha...@gmx.de>:
> 
> Hello List,
> 
> separatly from other mail with proxy_fcgi/enablereuse problem i want to tell about my results. This is quite interesting.
> System is Ubuntu16.04, libnghttp2-14 1.7.1, Apache 2.4.29, php 7.0.25
> 
> All tests were startet with this params: h2load  -n100000 -c100 -m10 https://example.com/infophp.php
> Tests used for this example were 100% successful:
> requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 failed, 0 errored, 0 timeout
> I run 10 Tests for every configuration, i just write here one significant result as example.
> 
> First test is mod_php with mpm_prefork
> finished in 42.87s, 2332.39 req/s, 253.63MB/s load average: 47,69
> 
> 2nd test is php-fpm with classic mod_fastcgi configuration using FastCGIExternalServer
> finished in 51.28s, 1950.25 req/s, 227.16MB/s load average: 60,70
> 
> 3rd test is php-fpm using fcgi_proxy configuration (unixsocket/enablereuse=off) and mpm_event
> finished in 47.54s, 2103.41 req/s, 225.35MB/s load average: 61,50
> 
> I expected that fcgi_proxy/mpm_event is quicker then mod_fastcgi, but i never expected that my winner in this test is mod_php. also there was lowest loadavg.
> This is especially remarkable because i use unofficial patch to activate http2 with mpm prefork along with "H2MaxWorkers 1" to avoid segfaults.
> Version 2.4.27 dropped support for http2 when using mpm_prefork through performance-probs reported by users.
> http://httpd.markmail.org/search/?q=Apache%20HTTP%20Server%202.4.27%20Released#query:Apache%20HTTP%20Server%202.4.27%20Released+page:1+mid:nsnewcr74hg6527f+state:results
> 
> I wonder why my test showed this result. May be mass-requesting of phpinfo is not comparable with a real production-server but altogether iam surprised.
> How to understand this result ?
> 
> Thanks,
> Hajo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] h2load http/2 benchmarkingresults using different mpm/php configurations

Posted by Stefan Eissing <st...@greenbytes.de>.
Except in (mostly upstream) traffic (or downstream when having lots of cache validations succeed).

In this example: 
HTTP/1.1 upstream: 18.33MB
HTTP/2   upstream:  2.87MB (space savings 85.65%)

-Stefan


> Am 22.01.2018 um 15:14 schrieb Eric Covener <co...@gmail.com>:
> 
> On Mon, Jan 22, 2018 at 9:02 AM, Hajo Locke <Ha...@gmx.de> wrote:
>> 
>> 
>> Am 22.01.2018 um 14:38 schrieb Eric Covener:
>>>> 
>>>> but i never expected that my winner in this test is mod_php. also there
>>>> was lowest
>>>> loadavg.
>>> 
>>> I don't think the motivations to pull the PHP interpreter out of the
>>> webserver process is performance -- that's one of the costs.
>> 
>> yes. my statement was made in the context of http2 > mpm_prefork > mod_php >
>> "H2Worker 1"
>> basically mod_php is a fast technique and depending on purpose a good
>> solution.
> 
> I think with very little latency and no dependencies in one flow it
> will be hard to see h2 benefits.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] h2load http/2 benchmarkingresults using different mpm/php configurations

Posted by Eric Covener <co...@gmail.com>.
On Mon, Jan 22, 2018 at 9:02 AM, Hajo Locke <Ha...@gmx.de> wrote:
>
>
> Am 22.01.2018 um 14:38 schrieb Eric Covener:
>>>
>>> but i never expected that my winner in this test is mod_php. also there
>>> was lowest
>>> loadavg.
>>
>> I don't think the motivations to pull the PHP interpreter out of the
>> webserver process is performance -- that's one of the costs.
>
> yes. my statement was made in the context of http2 > mpm_prefork > mod_php >
> "H2Worker 1"
> basically mod_php is a fast technique and depending on purpose a good
> solution.

I think with very little latency and no dependencies in one flow it
will be hard to see h2 benefits.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] h2load http/2 benchmarkingresults using different mpm/php configurations

Posted by Hajo Locke <Ha...@gmx.de>.

Am 22.01.2018 um 14:38 schrieb Eric Covener:
>> but i never expected that my winner in this test is mod_php. also there was lowest
>> loadavg.
> I don't think the motivations to pull the PHP interpreter out of the
> webserver process is performance -- that's one of the costs.
yes. my statement was made in the context of http2 > mpm_prefork > 
mod_php > "H2Worker 1"
basically mod_php is a fast technique and depending on purpose a good 
solution.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] h2load http/2 benchmarkingresults using different mpm/php configurations

Posted by Eric Covener <co...@gmail.com>.
> but i never expected that my winner in this test is mod_php. also there was lowest
> loadavg.

I don't think the motivations to pull the PHP interpreter out of the
webserver process is performance -- that's one of the costs.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org