Deutsch   English   Français   Italiano  
<vd1bdp$3npm3$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk>
Newsgroups: comp.os.vms
Subject: Re: Apache + mod_php performance
Date: Wed, 25 Sep 2024 11:49:13 -0400
Organization: A noiseless patient Spider
Lines: 107
Message-ID: <vd1bdp$3npm3$1@dont-email.me>
References: <vcv0bl$39mnj$1@dont-email.me> <vcv9q5$ddb$1@reader1.panix.com>
 <vcvmu1$3cnv1$2@dont-email.me> <vd10re$nmp$1@reader1.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 25 Sep 2024 17:49:13 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d4281ad6ebeb85e453d8de8216cd8046";
	logging-data="3925699"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/qmo7cU1qb4cfQY58cGK/8WDIgJbHfIQQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:eoYGdtvIL1DRJaIftfnWpam0yFM=
In-Reply-To: <vd10re$nmp$1@reader1.panix.com>
Content-Language: en-US
Bytes: 5028

On 9/25/2024 8:48 AM, Dan Cross wrote:
> In article <vcvmu1$3cnv1$2@dont-email.me>,
> Arne Vajhøj  <arne@vajhoej.dk> wrote:
>> On 9/24/2024 5:09 PM, Dan Cross wrote:
>>> In article <vcv0bl$39mnj$1@dont-email.me>,
>>> Arne Vajhøj  <arne@vajhoej.dk> wrote:
>>>> I am not impressed by Apache + mod_php performance on VMS.
>>>>
>>>> The basic numbers I see (simple PHP code for getting some data
>>>> out of a MySQL database and displaying) are:
>>>>
>>>> Apache + CGI : 4 req/sec = 240 req/min
>>>> Apache + mod_php : 11 req/sec = 660 req/min
>>>> Tomcat + Quercus : 127 req/sec = 7620 req/min
>>>>
>>>> (VMS x86-64 9.2-2, Apache 2.4-58, Berryman PHP 8.1,
>>>> Java 8u372, Tomcat 8.5-89, Quercus 4.0)
>>>>
>>>> That CGI is slow is no surprise. Using CGI for performance
>>>> is like doing 100 meter crawl dressed in medieval armor.
>>>>
>>>> But I had expected much better numbers for mod_php. Instead
>>>> of the actual x2.5 and x10 I had expected like x10 and x2.5
>>>> between the three.
>>>>
>>>> Anyone having any ideas for why it is like this and what
>>>> can be done about it?
>>>
>>> Did you try running your test script under the PHP interpreter
>>> directly, without the web stack?  What kind of QPS numbers do
>>> you see if it's just PHP talking to MySQL?
>>
>> Just executing the same PHP code in a loop give much higher
>> performance.
>>
>> Single process : 158 executions per second = 9480 executions per minute
>>
>> And multi process could probably get significantly higher.
> 
> So this suggests that your PHP code, by itself, is not the
> bottleneck,

The PHP code is very simple: read 3 rows from a database table
and output 35 lines of HTML.

>              though it remains unclear to me what you mean when
> you say, "just executing the same PHP code in a loop...": does
> this mean that you're running the PHP interpreter itself in a
> loop?  As in, starting it fresh on every iteration?  Or does
> this mean that you've got a loop inside the PHP program that
> runs your test and you're measuring the throughput of that?  And
> is this standalone, or executed under the web framework?  That
> is, are you running this under Apache and hitting some query
> that then causes the PHP interpreter to repeatedly query the
> database?

PHP script with a loop executing the same code as the web
request inside the loop. PHP script run command line.
No Apache or mod_php involved.

>>> With no further details, I'd wonder if you're not caching
>>> connections to the database between queries.
>>
>> Does not matter.
> 
> Surely it does.  If, for whatever reason, you're not holding
> onto the connection to the database between queries, but rather,
> re-establishing it each time, that will obviously have overhead
> that will impact performance.
> 
> Or perhaps you're saying this because of some unstated
> assumption alluded to in the questions above?

I am saying this because the numbers were the same. 11 req/sec
in both cases.

>> I just found out that Tomcat+Quercus numbers get even higher
>> after some warmup.
>>
>>                      no db con pool    db con pool
>> Apache + CGI              4              N/A
>> Apache + mod_php         11               11
>> Tomcat + Quercus        208              214
> 
> That's nice, but that seems irrelevant to the question of why
> PHP under Apache is so slow.

You brought up the topic, so I tested.

> Perhaps a simpler question: what sort of throughput does Apache
> on VMS give you if you just hit a simple static resource
> repeatedly?

Now it becomes interesting.

nop.php also gives 11 req/sec.

And nop.txt also gives 11 req/sec.

So the arrow is definitely pointing towards Apache.

So either something to speed up Apache or switching to WASD or OSU.

Arne