Welcome! Log In Create A New Profile

Advanced

[PHP] Performance / AB issue?

Posted by Lars Nielsen 
Lars Nielsen
[PHP] Performance / AB issue?
May 10, 2012 09:10AM
Hi there,

I have apache-2.22/php 5.3.10 set up on a dedicated server but I have a
strange issue.

I have made a Drupal 7 site with a mysql db.

If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it works
fine.
If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it kills
apache.
If I stress-test the site with : ab -c 50 -n 1500
http://sitename/static.html it works fine.

I have set apache's errorlog to debug. But it writes nothing, either in
the virtualhost or in the server-file.

Can anyone give a hint about what can be wrong?


Best regards
LFWeb
Lars Nielsen


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Matijn Woudt
Re: [PHP] Performance / AB issue?
May 10, 2012 05:50PM
On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]> wrote:
> Hi there,
>
> I have apache-2.22/php 5.3.10 set up on a dedicated server but I have a
> strange issue.
>
> I have made a Drupal 7 site with a mysql db.
>
> If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it works
> fine.
> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it kills
> apache.
> If I stress-test the site with : ab -c 50 -n 1500
> http://sitename/static.html it works fine.
>
> I have set apache's errorlog to debug. But it writes nothing, either in
> the virtualhost or in the server-file.
>
> Can anyone give a hint about what can be wrong?
>
>

What do you mean with 'kills apache', does it terminate apache or does
apache hang (eg. 100% cpu), and respond normal after the stress test
is over?
And what is the index of your site? A php script, or..? Do you have
ModRewrite redirects etc?

- Matijn

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Camilo Sperberg
Re: [PHP] Performance / AB issue?
May 10, 2012 07:20PM
Sent from my iPhone 5 Beta [Confidential use only]

On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:

> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]> wrote:
>> Hi there,
>>
>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I have a
>> strange issue.
>>
>> I have made a Drupal 7 site with a mysql db.
>>
>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it works
>> fine.
>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it kills
>> apache.
>> If I stress-test the site with : ab -c 50 -n 1500
>> http://sitename/static.html it works fine.
>>
>> I have set apache's errorlog to debug. But it writes nothing, either in
>> the virtualhost or in the server-file.
>>
>> Can anyone give a hint about what can be wrong?
>>
>>
>
> What do you mean with 'kills apache', does it terminate apache or does
> apache hang (eg. 100% cpu), and respond normal after the stress test
> is over?
> And what is the index of your site? A php script, or..? Do you have
> ModRewrite redirects etc?
>
> - Matijn
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Can you visit the site normally? Try less verbosing in apache, that is pretty intensive, but as you can benchmark a static file well (with moderate high settings), i assume it is some configuration problem in drupal.

Greeting.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lars Nielsen
Re: [PHP] Performance / AB issue?
May 10, 2012 11:32PM
>
>
> Sent from my iPhone 5 Beta [Confidential use only]
>
> On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:
>
>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]> wrote:
>>> Hi there,
>>>
>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I have a
>>> strange issue.
>>>
>>> I have made a Drupal 7 site with a mysql db.
>>>
>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it
>>> works
>>> fine.
>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it
>>> kills
>>> apache.
>>> If I stress-test the site with : ab -c 50 -n 1500
>>> http://sitename/static.html it works fine.
>>>
>>> I have set apache's errorlog to debug. But it writes nothing, either in
>>> the virtualhost or in the server-file.
>>>
>>> Can anyone give a hint about what can be wrong?
>>>
>>>
>>
>> What do you mean with 'kills apache', does it terminate apache or does
>> apache hang (eg. 100% cpu), and respond normal after the stress test
>> is over?
>> And what is the index of your site? A php script, or..? Do you have
>> ModRewrite redirects etc?
>>
>> - Matijn
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Can you visit the site normally? Try less verbosing in apache, that is
> pretty intensive, but as you can benchmark a static file well (with
> moderate high settings), i assume it is some configuration problem in
> drupal.
>
> Greeting.
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Hi,

I can visit the site normaly, but with 2-3 concurrent ab test it fails.
seen from 'ps' and 'htop' it seems that both apache and mysql continues to
run normaly but it doesnt respond.

If i run netstat -an after the test it shows this :
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 1 0 x.x.x.x:80 x.x.x.x:39237 CLOSE_WAIT
tcp 1 0 x.x.x.x:80 x.x.x.x:39236 CLOSE_WAIT
tcp 0 0 x.x.x.x:22 x.x.x.x:47383 ESTABLISHED
tcp 0 0 127.0.0.1:80 127.0.0.1:34775
ESTABLISHED
tcp 1 0 x.x.x.x:80 x.x.x.x:39300 CLOSE_WAIT
ESTABLISHED
tcp 0 0 127.0.0.1:34775 127.0.0.1:80
ESTABLISHED
tcp 0 0 x.x.x.x:80 x.x.x.x:39330 ESTABLISHED
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN

So it does seem like there should be room for new tcp connections?

But if I restart apache then it works again... So I guess it is a
apache/php configuration issue?

--
Med venlig hilsen / Best Regards

LFWeb
Lars Nielsen
Thorsensvej 30
4800 Nykøbing Falster
Tlf: +45 20 64 85 76
email : lars@lfweb.dk
www : http://www.lfweb.dk


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Matijn Woudt
Re: [PHP] Performance / AB issue?
May 11, 2012 12:30AM
On Thu, May 10, 2012 at 11:26 PM, Lars Nielsen <[email protected]> wrote:
>
>>
>>
>> Sent from my iPhone 5 Beta [Confidential use only]
>>
>> On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:
>>
>>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]> wrote:
>>>> Hi there,
>>>>
>>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I have a
>>>> strange issue.
>>>>
>>>> I have made a Drupal 7 site with a mysql db.
>>>>
>>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it
>>>> works
>>>> fine.
>>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it
>>>> kills
>>>> apache.
>>>> If I stress-test the site with : ab -c 50 -n 1500
>>>> http://sitename/static.html it works fine.
>>>>
>>>> I have set apache's errorlog to debug. But it writes nothing, either in
>>>> the virtualhost or in the server-file.
>>>>
>>>> Can anyone give a hint about what can be wrong?
>>>>
>>>>
>>>
>>> What do you mean with 'kills apache', does it terminate apache or does
>>> apache hang (eg. 100% cpu), and respond normal after the stress test
>>> is over?
>>> And what is the index of your site? A php script, or..? Do you have
>>> ModRewrite redirects etc?
>>>
>>> - Matijn
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>> Can you visit the site normally? Try less verbosing in apache, that is
>> pretty intensive, but as you can benchmark a static file well (with
>> moderate high settings), i assume it is some configuration problem in
>> drupal.
>>
>> Greeting.
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> Hi,
>
> I can visit the site normaly, but with 2-3 concurrent ab test it fails.
> seen from 'ps' and 'htop' it seems that both apache and mysql continues to
> run normaly but it doesnt respond.
>

That sounds like a deadlock or something.. It's also possible it is
waiting for MySQL to respond and some deadlock might happen there

> If i run netstat -an after the test it shows this :
> Active Internet connections (servers and established)
> Proto Recv-Q Send-Q Local Address           Foreign Address  State
> tcp        0      0 0.0.0.0:22              0.0.0.0:*        LISTEN
> tcp        0      0 127.0.0.1:25            0.0.0.0:*        LISTEN
> tcp        0      0 127.0.0.1:3306          0.0.0.0:*        LISTEN
> tcp        0      0 0.0.0.0:80              0.0.0.0:*        LISTEN
> tcp        1      0 x.x.x.x:80        x.x.x.x:39237   CLOSE_WAIT
> tcp        1      0 x.x.x.x:80        x.x.x.x:39236    CLOSE_WAIT
> tcp        0      0 x.x.x.x:22        x.x.x.x:47383    ESTABLISHED
> tcp        0      0 127.0.0.1:80            127.0.0.1:34775
> ESTABLISHED
> tcp        1      0 x.x.x.x:80        x.x.x.x:39300    CLOSE_WAIT
> ESTABLISHED
> tcp        0      0 127.0.0.1:34775         127.0.0.1:80
> ESTABLISHED
> tcp        0      0 x.x.x.x:80        x.x.x.x:39330    ESTABLISHED
> tcp6       0      0 :::22                   :::*                    LISTEN
> tcp6       0      0 ::1:25                  :::*                    LISTEN
>
> So it does seem like there should be room for new tcp connections?

even 10.000 connections at the same time should be fine

>
> But if I restart apache then it works again... So I guess it is a
> apache/php configuration issue?
>

Did you try to run ab from the same server (with http://localhost/) too?
Also, are you running any optimization stuff, like memcached?

- Matijn

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Camilo Sperberg
Re: [PHP] Performance / AB issue?
May 11, 2012 01:30AM
On 10 mei 2012, at 23:26, Lars Nielsen wrote:

>
>>
>>
>> Sent from my iPhone 5 Beta [Confidential use only]
>>
>> On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:
>>
>>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]> wrote:
>>>> Hi there,
>>>>
>>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I have a
>>>> strange issue.
>>>>
>>>> I have made a Drupal 7 site with a mysql db.
>>>>
>>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it
>>>> works
>>>> fine.
>>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it
>>>> kills
>>>> apache.
>>>> If I stress-test the site with : ab -c 50 -n 1500
>>>> http://sitename/static.html it works fine.
>>>>
>>>> I have set apache's errorlog to debug. But it writes nothing, either in
>>>> the virtualhost or in the server-file.
>>>>
>>>> Can anyone give a hint about what can be wrong?
>>>>
>>>>
>>>
>>> What do you mean with 'kills apache', does it terminate apache or does
>>> apache hang (eg. 100% cpu), and respond normal after the stress test
>>> is over?
>>> And what is the index of your site? A php script, or..? Do you have
>>> ModRewrite redirects etc?
>>>
>>> - Matijn
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>> Can you visit the site normally? Try less verbosing in apache, that is
>> pretty intensive, but as you can benchmark a static file well (with
>> moderate high settings), i assume it is some configuration problem in
>> drupal.
>>
>> Greeting.
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> Hi,
>
> I can visit the site normaly, but with 2-3 concurrent ab test it fails.
> seen from 'ps' and 'htop' it seems that both apache and mysql continues to
> run normaly but it doesnt respond.
>
> If i run netstat -an after the test it shows this :
> Active Internet connections (servers and established)
> Proto Recv-Q Send-Q Local Address Foreign Address State
> tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
> tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
> tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
> tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
> tcp 1 0 x.x.x.x:80 x.x.x.x:39237 CLOSE_WAIT
> tcp 1 0 x.x.x.x:80 x.x.x.x:39236 CLOSE_WAIT
> tcp 0 0 x.x.x.x:22 x.x.x.x:47383 ESTABLISHED
> tcp 0 0 127.0.0.1:80 127.0.0.1:34775
> ESTABLISHED
> tcp 1 0 x.x.x.x:80 x.x.x.x:39300 CLOSE_WAIT
> ESTABLISHED
> tcp 0 0 127.0.0.1:34775 127.0.0.1:80
> ESTABLISHED
> tcp 0 0 x.x.x.x:80 x.x.x.x:39330 ESTABLISHED
> tcp6 0 0 :::22 :::* LISTEN
> tcp6 0 0 ::1:25 :::* LISTEN
>
> So it does seem like there should be room for new tcp connections?
>
> But if I restart apache then it works again... So I guess it is a
> apache/php configuration issue?
>
> --
> Med venlig hilsen / Best Regards
>
> LFWeb
> Lars Nielsen
> Thorsensvej 30
> 4800 Nykøbing Falster
> Tlf: +45 20 64 85 76
> email : lars@lfweb.dk
> www : http://www.lfweb.dk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Have you tried benchmarking a really simple php page, such as

<?php echo 'hello world'; ?>

?

It that works, than it is definitely an issue in Drupal's configuration and not in PHP/Apache. Additionally, you could check what happens when you try to establish a session or make a database call to rule out those as well, just make really simple tests that you know wouldn't fail and run ab on them.

Greetings.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lars Nielsen
Re: [PHP] Performance / AB issue?
May 11, 2012 07:20AM
>
> On 10 mei 2012, at 23:26, Lars Nielsen wrote:
>
>>
>>>
>>>
>>> Sent from my iPhone 5 Beta [Confidential use only]
>>>
>>> On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:
>>>
>>>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]> wrote:
>>>>> Hi there,
>>>>>
>>>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I have
>>>>> a
>>>>> strange issue.
>>>>>
>>>>> I have made a Drupal 7 site with a mysql db.
>>>>>
>>>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it
>>>>> works
>>>>> fine.
>>>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it
>>>>> kills
>>>>> apache.
>>>>> If I stress-test the site with : ab -c 50 -n 1500
>>>>> http://sitename/static.html it works fine.
>>>>>
>>>>> I have set apache's errorlog to debug. But it writes nothing, either
>>>>> in
>>>>> the virtualhost or in the server-file.
>>>>>
>>>>> Can anyone give a hint about what can be wrong?
>>>>>
>>>>>
>>>>
>>>> What do you mean with 'kills apache', does it terminate apache or does
>>>> apache hang (eg. 100% cpu), and respond normal after the stress test
>>>> is over?
>>>> And what is the index of your site? A php script, or..? Do you have
>>>> ModRewrite redirects etc?
>>>>
>>>> - Matijn
>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>
>>> Can you visit the site normally? Try less verbosing in apache, that is
>>> pretty intensive, but as you can benchmark a static file well (with
>>> moderate high settings), i assume it is some configuration problem in
>>> drupal.
>>>
>>> Greeting.
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>> Hi,
>>
>> I can visit the site normaly, but with 2-3 concurrent ab test it fails.
>> seen from 'ps' and 'htop' it seems that both apache and mysql continues
>> to
>> run normaly but it doesnt respond.
>>
>> If i run netstat -an after the test it shows this :
>> Active Internet connections (servers and established)
>> Proto Recv-Q Send-Q Local Address Foreign Address State
>> tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
>> tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
>> tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
>> tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
>> tcp 1 0 x.x.x.x:80 x.x.x.x:39237 CLOSE_WAIT
>> tcp 1 0 x.x.x.x:80 x.x.x.x:39236 CLOSE_WAIT
>> tcp 0 0 x.x.x.x:22 x.x.x.x:47383 ESTABLISHED
>> tcp 0 0 127.0.0.1:80 127.0.0.1:34775
>> ESTABLISHED
>> tcp 1 0 x.x.x.x:80 x.x.x.x:39300 CLOSE_WAIT
>> ESTABLISHED
>> tcp 0 0 127.0.0.1:34775 127.0.0.1:80
>> ESTABLISHED
>> tcp 0 0 x.x.x.x:80 x.x.x.x:39330 ESTABLISHED
>> tcp6 0 0 :::22 :::*
>> LISTEN
>> tcp6 0 0 ::1:25 :::*
>> LISTEN
>>
>> So it does seem like there should be room for new tcp connections?
>>
>> But if I restart apache then it works again... So I guess it is a
>> apache/php configuration issue?
>>
>> --
>> Med venlig hilsen / Best Regards
>>
>> LFWeb
>> Lars Nielsen
>> Thorsensvej 30
>> 4800 Nykøbing Falster
>> Tlf: +45 20 64 85 76
>> email : lars@lfweb.dk
>> www : http://www.lfweb.dk
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Have you tried benchmarking a really simple php page, such as
>
> <?php echo 'hello world'; ?>
>
> ?
>
> It that works, than it is definitely an issue in Drupal's configuration
> and not in PHP/Apache. Additionally, you could check what happens when you
> try to establish a session or make a database call to rule out those as
> well, just make really simple tests that you know wouldn't fail and run ab
> on them.
>
> Greetings.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Thanks!

Now I have made
<?php
echo "Hey from PHP!";
?>

It runs fine from a little concurrency. But with "-c 5 -n 500" it fails
after 308 requests!



Best Regards / Med venlig hilsen

LFWeb
Lars Nielsen


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Camilo Sperberg
Re: [PHP] Performance / AB issue?
May 11, 2012 10:00AM
Sent from my iPhone 5 Beta [Confidential use only]

On 11 mei 2012, at 07:09, "Lars Nielsen" <[email protected]> wrote:

>
>>
>> On 10 mei 2012, at 23:26, Lars Nielsen wrote:
>>
>>>
>>>>
>>>>
>>>> Sent from my iPhone 5 Beta [Confidential use only]
>>>>
>>>> On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:
>>>>
>>>>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]> wrote:
>>>>>> Hi there,
>>>>>>
>>>>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I have
>>>>>> a
>>>>>> strange issue.
>>>>>>
>>>>>> I have made a Drupal 7 site with a mysql db.
>>>>>>
>>>>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it
>>>>>> works
>>>>>> fine.
>>>>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it
>>>>>> kills
>>>>>> apache.
>>>>>> If I stress-test the site with : ab -c 50 -n 1500
>>>>>> http://sitename/static.html it works fine.
>>>>>>
>>>>>> I have set apache's errorlog to debug. But it writes nothing, either
>>>>>> in
>>>>>> the virtualhost or in the server-file.
>>>>>>
>>>>>> Can anyone give a hint about what can be wrong?
>>>>>>
>>>>>>
>>>>>
>>>>> What do you mean with 'kills apache', does it terminate apache or does
>>>>> apache hang (eg. 100% cpu), and respond normal after the stress test
>>>>> is over?
>>>>> And what is the index of your site? A php script, or..? Do you have
>>>>> ModRewrite redirects etc?
>>>>>
>>>>> - Matijn
>>>>>
>>>>> --
>>>>> PHP General Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>
>>>> Can you visit the site normally? Try less verbosing in apache, that is
>>>> pretty intensive, but as you can benchmark a static file well (with
>>>> moderate high settings), i assume it is some configuration problem in
>>>> drupal.
>>>>
>>>> Greeting.
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>>
>>> Hi,
>>>
>>> I can visit the site normaly, but with 2-3 concurrent ab test it fails.
>>> seen from 'ps' and 'htop' it seems that both apache and mysql continues
>>> to
>>> run normaly but it doesnt respond.
>>>
>>> If i run netstat -an after the test it shows this :
>>> Active Internet connections (servers and established)
>>> Proto Recv-Q Send-Q Local Address Foreign Address State
>>> tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
>>> tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
>>> tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
>>> tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
>>> tcp 1 0 x.x.x.x:80 x.x.x.x:39237 CLOSE_WAIT
>>> tcp 1 0 x.x.x.x:80 x.x.x.x:39236 CLOSE_WAIT
>>> tcp 0 0 x.x.x.x:22 x.x.x.x:47383 ESTABLISHED
>>> tcp 0 0 127.0.0.1:80 127.0.0.1:34775
>>> ESTABLISHED
>>> tcp 1 0 x.x.x.x:80 x.x.x.x:39300 CLOSE_WAIT
>>> ESTABLISHED
>>> tcp 0 0 127.0.0.1:34775 127.0.0.1:80
>>> ESTABLISHED
>>> tcp 0 0 x.x.x.x:80 x.x.x.x:39330 ESTABLISHED
>>> tcp6 0 0 :::22 :::*
>>> LISTEN
>>> tcp6 0 0 ::1:25 :::*
>>> LISTEN
>>>
>>> So it does seem like there should be room for new tcp connections?
>>>
>>> But if I restart apache then it works again... So I guess it is a
>>> apache/php configuration issue?
>>>
>>> --
>>> Med venlig hilsen / Best Regards
>>>
>>> LFWeb
>>> Lars Nielsen
>>> Thorsensvej 30
>>> 4800 Nykøbing Falster
>>> Tlf: +45 20 64 85 76
>>> email : lars@lfweb.dk
>>> www : http://www.lfweb.dk
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>> Have you tried benchmarking a really simple php page, such as
>>
>> <?php echo 'hello world'; ?>
>>
>> ?
>>
>> It that works, than it is definitely an issue in Drupal's configuration
>> and not in PHP/Apache. Additionally, you could check what happens when you
>> try to establish a session or make a database call to rule out those as
>> well, just make really simple tests that you know wouldn't fail and run ab
>> on them.
>>
>> Greetings.
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> Thanks!
>
> Now I have made
> <?php
> echo "Hey from PHP!";
> ?>
>
> It runs fine from a little concurrency. But with "-c 5 -n 500" it fails
> after 308 requests!
>
>
>
> Best Regards / Med venlig hilsen
>
> LFWeb
> Lars Nielsen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Have you tried benchmarking from localhost? Do you have any active firewall? Selinux? Shorewall? Anything that could block a ddos attack?

Greetings.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Matijn Woudt
Re: [PHP] Performance / AB issue?
May 11, 2012 11:50AM
On Fri, May 11, 2012 at 9:53 AM, Camilo Sperberg <[email protected]> wrote:
>
>
> Sent from my iPhone 5 Beta [Confidential use only]
>
> On 11 mei 2012, at 07:09, "Lars Nielsen" <[email protected]> wrote:
>
>>
>>>
>>> On 10 mei 2012, at 23:26, Lars Nielsen wrote:
>>>
>>>>
>>>>>
>>>>>
>>>>> Sent from my iPhone 5 Beta [Confidential use only]
>>>>>
>>>>> On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:
>>>>>
>>>>>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]> wrote:
>>>>>>> Hi there,
>>>>>>>
>>>>>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I have
>>>>>>> a
>>>>>>> strange issue.
>>>>>>>
>>>>>>> I have made a Drupal 7 site with a mysql db.
>>>>>>>
>>>>>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/ it
>>>>>>> works
>>>>>>> fine.
>>>>>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it
>>>>>>> kills
>>>>>>> apache.
>>>>>>> If I stress-test the site with : ab -c 50 -n 1500
>>>>>>> http://sitename/static.html it works fine.
>>>>>>>
>>>>>>> I have set apache's errorlog to debug. But it writes nothing, either
>>>>>>> in
>>>>>>> the virtualhost or in the server-file.
>>>>>>>
>>>>>>> Can anyone give a hint about what can be wrong?
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> What do you mean with 'kills apache', does it terminate apache or does
>>>>>> apache hang (eg. 100% cpu), and respond normal after the stress test
>>>>>> is over?
>>>>>> And what is the index of your site? A php script, or..? Do you have
>>>>>> ModRewrite redirects etc?
>>>>>>
>>>>>> - Matijn
>>>>>>
>>>>>> --
>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>
>>>>>
>>>>> Can you visit the site normally? Try less verbosing in apache, that is
>>>>> pretty intensive, but as you can benchmark a static file well (with
>>>>> moderate high settings), i assume it is some configuration problem in
>>>>> drupal.
>>>>>
>>>>> Greeting.
>>>>> --
>>>>> PHP General Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>>
>>>>
>>>> Hi,
>>>>
>>>> I can visit the site normaly, but with 2-3 concurrent ab test it fails..
>>>> seen from 'ps' and 'htop' it seems that both apache and mysql continues
>>>> to
>>>> run normaly but it doesnt respond.
>>>>
>>>> If i run netstat -an after the test it shows this :
>>>> Active Internet connections (servers and established)
>>>> Proto Recv-Q Send-Q Local Address           Foreign Address  State
>>>> tcp        0      0 0.0.0.0:22              0.0.0.0:*        LISTEN
>>>> tcp        0      0 127.0.0.1:25            0.0.0.0:*        LISTEN
>>>> tcp        0      0 127.0.0.1:3306          0.0.0.0:*        LISTEN
>>>> tcp        0      0 0.0.0.0:80              0.0.0.0:*        LISTEN
>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39237   CLOSE_WAIT
>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39236    CLOSE_WAIT
>>>> tcp        0      0 x.x.x.x:22        x.x.x.x:47383    ESTABLISHED
>>>> tcp        0      0 127.0.0.1:80            127.0.0.1:34775
>>>> ESTABLISHED
>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39300    CLOSE_WAIT
>>>> ESTABLISHED
>>>> tcp        0      0 127.0.0.1:34775         127.0.0.1:80
>>>> ESTABLISHED
>>>> tcp        0      0 x.x.x.x:80        x.x.x.x:39330    ESTABLISHED
>>>> tcp6       0      0 :::22                   :::*
>>>> LISTEN
>>>> tcp6       0      0 ::1:25                  :::*
>>>> LISTEN
>>>>
>>>> So it does seem like there should be room for new tcp connections?
>>>>
>>>> But if I restart apache then it works again... So I guess it is a
>>>> apache/php configuration issue?
>>>>
>>>> --
>>>> Med venlig hilsen / Best Regards
>>>>
>>>> LFWeb
>>>> Lars Nielsen
>>>> Thorsensvej 30
>>>> 4800 Nykøbing Falster
>>>> Tlf: +45 20 64 85 76
>>>> email : lars@lfweb.dk
>>>> www : http://www.lfweb.dk
>>>>
>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>
>>> Have you tried benchmarking a really simple php page, such as
>>>
>>> <?php echo 'hello world'; ?>
>>>
>>> ?
>>>
>>> It that works, than it is definitely an issue in Drupal's configuration
>>> and not in PHP/Apache. Additionally, you could check what happens when you
>>> try to establish a session or make a database call to rule out those as
>>> well, just make really simple tests that you know wouldn't fail and run ab
>>> on them.
>>>
>>> Greetings.
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>> Thanks!
>>
>> Now I have made
>> <?php
>>  echo "Hey from PHP!";
>> ?>
>>
>> It runs fine from a little concurrency. But with "-c 5 -n 500" it fails
>> after 308 requests!
>>
>>
>>
>> Best Regards / Med venlig hilsen
>>
>> LFWeb
>> Lars Nielsen
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Have you tried benchmarking from localhost? Do you have any active firewall? Selinux? Shorewall? Anything that could block a ddos attack?
>

A firewall is not the case here. He's testing with -c 2 and is getting
errors, with -c 50 on a static file not. Also, blocking a DDOS attack
at only 50 connections is way too low, so I don't think that would
happen.

- Matijn

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Mike Mackintosh
Re: [PHP] Performance / AB issue?
May 11, 2012 12:00PM
How is PHP running, fast-cgi, sapi, etc..?

Is there anything in the error_log for apache? Could be an issue with prefork/worker.

Thanks,

Mike Mackintosh
PHP, the drug of choice - www.highonphp.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lars Nielsen
Re: [PHP] Performance / AB issue?
May 11, 2012 12:40PM
> On Fri, May 11, 2012 at 9:53 AM, Camilo Sperberg <[email protected]>
> wrote:
>>
>>
>> Sent from my iPhone 5 Beta [Confidential use only]
>>
>> On 11 mei 2012, at 07:09, "Lars Nielsen" <[email protected]> wrote:
>>
>>>
>>>>
>>>> On 10 mei 2012, at 23:26, Lars Nielsen wrote:
>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>> Sent from my iPhone 5 Beta [Confidential use only]
>>>>>>
>>>>>> On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:
>>>>>>
>>>>>>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]>
>>>>>>> wrote:
>>>>>>>> Hi there,
>>>>>>>>
>>>>>>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I
>>>>>>>> have
>>>>>>>> a
>>>>>>>> strange issue.
>>>>>>>>
>>>>>>>> I have made a Drupal 7 site with a mysql db.
>>>>>>>>
>>>>>>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/
>>>>>>>> it
>>>>>>>> works
>>>>>>>> fine.
>>>>>>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it
>>>>>>>> kills
>>>>>>>> apache.
>>>>>>>> If I stress-test the site with : ab -c 50 -n 1500
>>>>>>>> http://sitename/static.html it works fine.
>>>>>>>>
>>>>>>>> I have set apache's errorlog to debug. But it writes nothing,
>>>>>>>> either
>>>>>>>> in
>>>>>>>> the virtualhost or in the server-file.
>>>>>>>>
>>>>>>>> Can anyone give a hint about what can be wrong?
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> What do you mean with 'kills apache', does it terminate apache or
>>>>>>> does
>>>>>>> apache hang (eg. 100% cpu), and respond normal after the stress
>>>>>>> test
>>>>>>> is over?
>>>>>>> And what is the index of your site? A php script, or..? Do you have
>>>>>>> ModRewrite redirects etc?
>>>>>>>
>>>>>>> - Matijn
>>>>>>>
>>>>>>> --
>>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>
>>>>>>
>>>>>> Can you visit the site normally? Try less verbosing in apache, that
>>>>>> is
>>>>>> pretty intensive, but as you can benchmark a static file well (with
>>>>>> moderate high settings), i assume it is some configuration problem
>>>>>> in
>>>>>> drupal.
>>>>>>
>>>>>> Greeting.
>>>>>> --
>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>
>>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I can visit the site normaly, but with 2-3 concurrent ab test it
>>>>> fails.
>>>>> seen from 'ps' and 'htop' it seems that both apache and mysql
>>>>> continues
>>>>> to
>>>>> run normaly but it doesnt respond.
>>>>>
>>>>> If i run netstat -an after the test it shows this :
>>>>> Active Internet connections (servers and established)
>>>>> Proto Recv-Q Send-Q Local Address           Foreign Address
>>>>>  State
>>>>> tcp        0      0 0.0.0.0:22              0.0.0.0:*
>>>>>        LISTEN
>>>>> tcp        0      0 127.0.0.1:25            0.0.0.0:*  
>>>>>      LISTEN
>>>>> tcp        0      0 127.0.0.1:3306          0.0.0.0:*  
>>>>>      LISTEN
>>>>> tcp        0      0 0.0.0.0:80              0.0.0.0:*
>>>>>        LISTEN
>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39237  
>>>>> CLOSE_WAIT
>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39236  
>>>>>  CLOSE_WAIT
>>>>> tcp        0      0 x.x.x.x:22        x.x.x.x:47383  
>>>>>  ESTABLISHED
>>>>> tcp        0      0 127.0.0.1:80          
>>>>>  127.0.0.1:34775
>>>>> ESTABLISHED
>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39300  
>>>>>  CLOSE_WAIT
>>>>> ESTABLISHED
>>>>> tcp        0      0 127.0.0.1:34775         127.0.0.1:80
>>>>> ESTABLISHED
>>>>> tcp        0      0 x.x.x.x:80        x.x.x.x:39330  
>>>>>  ESTABLISHED
>>>>> tcp6       0      0 :::22                   :::*
>>>>> LISTEN
>>>>> tcp6       0      0 ::1:25                  :::*
>>>>> LISTEN
>>>>>
>>>>> So it does seem like there should be room for new tcp connections?
>>>>>
>>>>> But if I restart apache then it works again... So I guess it is a
>>>>> apache/php configuration issue?
>>>>>
>>>>> --
>>>>> Med venlig hilsen / Best Regards
>>>>>
>>>>> LFWeb
>>>>> Lars Nielsen
>>>>> Thorsensvej 30
>>>>> 4800 Nykøbing Falster
>>>>> Tlf: +45 20 64 85 76
>>>>> email : lars@lfweb.dk
>>>>> www : http://www.lfweb.dk
>>>>>
>>>>>
>>>>> --
>>>>> PHP General Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>
>>>> Have you tried benchmarking a really simple php page, such as
>>>>
>>>> <?php echo 'hello world'; ?>
>>>>
>>>> ?
>>>>
>>>> It that works, than it is definitely an issue in Drupal's
>>>> configuration
>>>> and not in PHP/Apache. Additionally, you could check what happens when
>>>> you
>>>> try to establish a session or make a database call to rule out those
>>>> as
>>>> well, just make really simple tests that you know wouldn't fail and
>>>> run ab
>>>> on them.
>>>>
>>>> Greetings.
>>>>
>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>> Thanks!
>>>
>>> Now I have made
>>> <?php
>>>  echo "Hey from PHP!";
>>> ?>
>>>
>>> It runs fine from a little concurrency. But with "-c 5 -n 500" it fails
>>> after 308 requests!
>>>
>>>
>>>
>>> Best Regards / Med venlig hilsen
>>>
>>> LFWeb
>>> Lars Nielsen
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>> Have you tried benchmarking from localhost? Do you have any active
>> firewall? Selinux? Shorewall? Anything that could block a ddos attack?
>>
>
> A firewall is not the case here. He's testing with -c 2 and is getting
> errors, with -c 50 on a static file not. Also, blocking a DDOS attack
> at only 50 connections is way too low, so I don't think that would
> happen.
>
> - Matijn
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Php is running as mod_php under an apache worker configuration.

Med venlig hilsen

LFWeb
Lars Nielsen


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lars Nielsen
Re: [PHP] Performance / AB issue?
May 15, 2012 11:50AM
> On Fri, May 11, 2012 at 9:53 AM, Camilo Sperberg <[email protected]>
> wrote:
>>
>>
>> Sent from my iPhone 5 Beta [Confidential use only]
>>
>> On 11 mei 2012, at 07:09, "Lars Nielsen" <[email protected]> wrote:
>>
>>>
>>>>
>>>> On 10 mei 2012, at 23:26, Lars Nielsen wrote:
>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>> Sent from my iPhone 5 Beta [Confidential use only]
>>>>>>
>>>>>> On 10 mei 2012, at 17:40, Matijn Woudt <ti[email protected]> wrote:
>>>>>>
>>>>>>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]>
>>>>>>> wrote:
>>>>>>>> Hi there,
>>>>>>>>
>>>>>>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I
>>>>>>>> have
>>>>>>>> a
>>>>>>>> strange issue.
>>>>>>>>
>>>>>>>> I have made a Drupal 7 site with a mysql db.
>>>>>>>>
>>>>>>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/
>>>>>>>> it
>>>>>>>> works
>>>>>>>> fine.
>>>>>>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/ it
>>>>>>>> kills
>>>>>>>> apache.
>>>>>>>> If I stress-test the site with : ab -c 50 -n 1500
>>>>>>>> http://sitename/static.html it works fine.
>>>>>>>>
>>>>>>>> I have set apache's errorlog to debug. But it writes nothing,
>>>>>>>> either
>>>>>>>> in
>>>>>>>> the virtualhost or in the server-file.
>>>>>>>>
>>>>>>>> Can anyone give a hint about what can be wrong?
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> What do you mean with 'kills apache', does it terminate apache or
>>>>>>> does
>>>>>>> apache hang (eg. 100% cpu), and respond normal after the stress
>>>>>>> test
>>>>>>> is over?
>>>>>>> And what is the index of your site? A php script, or..? Do you have
>>>>>>> ModRewrite redirects etc?
>>>>>>>
>>>>>>> - Matijn
>>>>>>>
>>>>>>> --
>>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>
>>>>>>
>>>>>> Can you visit the site normally? Try less verbosing in apache, that
>>>>>> is
>>>>>> pretty intensive, but as you can benchmark a static file well (with
>>>>>> moderate high settings), i assume it is some configuration problem
>>>>>> in
>>>>>> drupal.
>>>>>>
>>>>>> Greeting.
>>>>>> --
>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>
>>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I can visit the site normaly, but with 2-3 concurrent ab test it
>>>>> fails.
>>>>> seen from 'ps' and 'htop' it seems that both apache and mysql
>>>>> continues
>>>>> to
>>>>> run normaly but it doesnt respond.
>>>>>
>>>>> If i run netstat -an after the test it shows this :
>>>>> Active Internet connections (servers and established)
>>>>> Proto Recv-Q Send-Q Local Address           Foreign Address
>>>>>  State
>>>>> tcp        0      0 0.0.0.0:22              0.0.0.0:*
>>>>>        LISTEN
>>>>> tcp        0      0 127.0.0.1:25            0.0.0.0:*  
>>>>>      LISTEN
>>>>> tcp        0      0 127.0.0.1:3306          0.0.0.0:*  
>>>>>      LISTEN
>>>>> tcp        0      0 0.0.0.0:80              0.0.0.0:*
>>>>>        LISTEN
>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39237  
>>>>> CLOSE_WAIT
>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39236  
>>>>>  CLOSE_WAIT
>>>>> tcp        0      0 x.x.x.x:22        x.x.x.x:47383  
>>>>>  ESTABLISHED
>>>>> tcp        0      0 127.0.0.1:80          
>>>>>  127.0.0.1:34775
>>>>> ESTABLISHED
>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39300  
>>>>>  CLOSE_WAIT
>>>>> ESTABLISHED
>>>>> tcp        0      0 127.0.0.1:34775         127.0.0.1:80
>>>>> ESTABLISHED
>>>>> tcp        0      0 x.x.x.x:80        x.x.x.x:39330  
>>>>>  ESTABLISHED
>>>>> tcp6       0      0 :::22                   :::*
>>>>> LISTEN
>>>>> tcp6       0      0 ::1:25                  :::*
>>>>> LISTEN
>>>>>
>>>>> So it does seem like there should be room for new tcp connections?
>>>>>
>>>>> But if I restart apache then it works again... So I guess it is a
>>>>> apache/php configuration issue?
>>>>>
>>>>> --
>>>>> Med venlig hilsen / Best Regards
>>>>>
>>>>> LFWeb
>>>>> Lars Nielsen
>>>>> Thorsensvej 30
>>>>> 4800 Nykøbing Falster
>>>>> Tlf: +45 20 64 85 76
>>>>> email : lars@lfweb.dk
>>>>> www : http://www.lfweb.dk
>>>>>
>>>>>
>>>>> --
>>>>> PHP General Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>
>>>> Have you tried benchmarking a really simple php page, such as
>>>>
>>>> <?php echo 'hello world'; ?>
>>>>
>>>> ?
>>>>
>>>> It that works, than it is definitely an issue in Drupal's
>>>> configuration
>>>> and not in PHP/Apache. Additionally, you could check what happens when
>>>> you
>>>> try to establish a session or make a database call to rule out those
>>>> as
>>>> well, just make really simple tests that you know wouldn't fail and
>>>> run ab
>>>> on them.
>>>>
>>>> Greetings.
>>>>
>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>> Thanks!
>>>
>>> Now I have made
>>> <?php
>>>  echo "Hey from PHP!";
>>> ?>
>>>
>>> It runs fine from a little concurrency. But with "-c 5 -n 500" it fails
>>> after 308 requests!
>>>
>>>
>>>
>>> Best Regards / Med venlig hilsen
>>>
>>> LFWeb
>>> Lars Nielsen
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>> Have you tried benchmarking from localhost? Do you have any active
>> firewall? Selinux? Shorewall? Anything that could block a ddos attack?
>>
>
> A firewall is not the case here. He's testing with -c 2 and is getting
> errors, with -c 50 on a static file not. Also, blocking a DDOS attack
> at only 50 connections is way too low, so I don't think that would
> happen.
>
> - Matijn
>
Now i have the result of a test on localhost:


ab -c 1 -n 20 http://localhost/
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 localhost (be patient).....done


Server Software: Apache/2.2.22
Server Hostname: localhost
Server Port: 80

Document Path: /
Document Length: 14463 bytes

Concurrency Level: 1
Time taken for tests: 3.540 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Total transferred: 298480 bytes
HTML transferred: 289260 bytes
Requests per second: 5.65 [#/sec] (mean)
Time per request: 177.020 [ms] (mean)
Time per request: 177.020 [ms] (mean, across all concurrent requests)
Transfer rate: 82.33 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 175 177 2.1 176 182
Waiting: 153 156 1.7 155 160
Total: 175 177 2.1 176 182

Percentage of the requests served within a certain time (ms)
50% 176
66% 177
75% 177
80% 178
90% 182
95% 182
98% 182
99% 182
100% 182 (longest request)

xx@grafikom:/home/xx# ab -c 2 -n 20 http://localhost/
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 localhost (be patient)...apr_poll: The timeout specified has
expired (70007)
Total of 3 requests completed


Does this give any meaning?


Med venlig hilsen

LFWeb
Lars Nielsen


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lars Nielsen
Re: [PHP] Performance / AB issue?
May 15, 2012 12:10PM
>
>> On Fri, May 11, 2012 at 9:53 AM, Camilo Sperberg <[email protected]>
>> wrote:
>>>
>>>
>>> Sent from my iPhone 5 Beta [Confidential use only]
>>>
>>> On 11 mei 2012, at 07:09, "Lars Nielsen" <[email protected]> wrote:
>>>
>>>>
>>>>>
>>>>> On 10 mei 2012, at 23:26, Lars Nielsen wrote:
>>>>>
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Sent from my iPhone 5 Beta [Confidential use only]
>>>>>>>
>>>>>>> On 10 mei 2012, at 17:40, Matijn Woudt <[email protected]> wrote:
>>>>>>>
>>>>>>>> On Thu, May 10, 2012 at 9:04 AM, Lars Nielsen <[email protected]>
>>>>>>>> wrote:
>>>>>>>>> Hi there,
>>>>>>>>>
>>>>>>>>> I have apache-2.22/php 5.3.10 set up on a dedicated server but I
>>>>>>>>> have
>>>>>>>>> a
>>>>>>>>> strange issue.
>>>>>>>>>
>>>>>>>>> I have made a Drupal 7 site with a mysql db.
>>>>>>>>>
>>>>>>>>> If I stress-test the site with : ab -c 1 -n 150 http://sitename/
>>>>>>>>> it
>>>>>>>>> works
>>>>>>>>> fine.
>>>>>>>>> If I stress-test the site with : ab -c 2 -n 20 http://sitename/
>>>>>>>>> it
>>>>>>>>> kills
>>>>>>>>> apache.
>>>>>>>>> If I stress-test the site with : ab -c 50 -n 1500
>>>>>>>>> http://sitename/static.html it works fine.
>>>>>>>>>
>>>>>>>>> I have set apache's errorlog to debug. But it writes nothing,
>>>>>>>>> either
>>>>>>>>> in
>>>>>>>>> the virtualhost or in the server-file.
>>>>>>>>>
>>>>>>>>> Can anyone give a hint about what can be wrong?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> What do you mean with 'kills apache', does it terminate apache or
>>>>>>>> does
>>>>>>>> apache hang (eg. 100% cpu), and respond normal after the stress
>>>>>>>> test
>>>>>>>> is over?
>>>>>>>> And what is the index of your site? A php script, or..? Do you
>>>>>>>> have
>>>>>>>> ModRewrite redirects etc?
>>>>>>>>
>>>>>>>> - Matijn
>>>>>>>>
>>>>>>>> --
>>>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>>
>>>>>>>
>>>>>>> Can you visit the site normally? Try less verbosing in apache, that
>>>>>>> is
>>>>>>> pretty intensive, but as you can benchmark a static file well (with
>>>>>>> moderate high settings), i assume it is some configuration problem
>>>>>>> in
>>>>>>> drupal.
>>>>>>>
>>>>>>> Greeting.
>>>>>>> --
>>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I can visit the site normaly, but with 2-3 concurrent ab test it
>>>>>> fails.
>>>>>> seen from 'ps' and 'htop' it seems that both apache and mysql
>>>>>> continues
>>>>>> to
>>>>>> run normaly but it doesnt respond.
>>>>>>
>>>>>> If i run netstat -an after the test it shows this :
>>>>>> Active Internet connections (servers and established)
>>>>>> Proto Recv-Q Send-Q Local Address           Foreign Address
>>>>>>  State
>>>>>> tcp        0      0 0.0.0.0:22              0.0.0.0:*
>>>>>>        LISTEN
>>>>>> tcp        0      0 127.0.0.1:25            0.0.0.0:*
>>>>>>  
>>>>>>      LISTEN
>>>>>> tcp        0      0 127.0.0.1:3306          0.0.0.0:*  
>>>>>>      LISTEN
>>>>>> tcp        0      0 0.0.0.0:80              0.0.0.0:*
>>>>>>        LISTEN
>>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39237  
>>>>>> CLOSE_WAIT
>>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39236  
>>>>>>  CLOSE_WAIT
>>>>>> tcp        0      0 x.x.x.x:22        x.x.x.x:47383  
>>>>>>  ESTABLISHED
>>>>>> tcp        0      0 127.0.0.1:80          
>>>>>>  127.0.0.1:34775
>>>>>> ESTABLISHED
>>>>>> tcp        1      0 x.x.x.x:80        x.x.x.x:39300  
>>>>>>  CLOSE_WAIT
>>>>>> ESTABLISHED
>>>>>> tcp        0      0 127.0.0.1:34775         127.0.0.1:80
>>>>>> ESTABLISHED
>>>>>> tcp        0      0 x.x.x.x:80        x.x.x.x:39330  
>>>>>>  ESTABLISHED
>>>>>> tcp6       0      0 :::22                   :::*
>>>>>> LISTEN
>>>>>> tcp6       0      0 ::1:25                  :::*
>>>>>> LISTEN
>>>>>>
>>>>>> So it does seem like there should be room for new tcp connections?
>>>>>>
>>>>>> But if I restart apache then it works again... So I guess it is a
>>>>>> apache/php configuration issue?
>>>>>>
>>>>>> --
>>>>>> Med venlig hilsen / Best Regards
>>>>>>
>>>>>> LFWeb
>>>>>> Lars Nielsen
>>>>>> Thorsensvej 30
>>>>>> 4800 Nykøbing Falster
>>>>>> Tlf: +45 20 64 85 76
>>>>>> email : lars@lfweb.dk
>>>>>> www : http://www.lfweb.dk
>>>>>>
>>>>>>
>>>>>> --
>>>>>> PHP General Mailing List (http://www.php.net/)
>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>
>>>>>
>>>>> Have you tried benchmarking a really simple php page, such as
>>>>>
>>>>> <?php echo 'hello world'; ?>
>>>>>
>>>>> ?
>>>>>
>>>>> It that works, than it is definitely an issue in Drupal's
>>>>> configuration
>>>>> and not in PHP/Apache. Additionally, you could check what happens
>>>>> when
>>>>> you
>>>>> try to establish a session or make a database call to rule out those
>>>>> as
>>>>> well, just make really simple tests that you know wouldn't fail and
>>>>> run ab
>>>>> on them.
>>>>>
>>>>> Greetings.
>>>>>
>>>>>
>>>>> --
>>>>> PHP General Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>>
>>>> Thanks!
>>>>
>>>> Now I have made
>>>> <?php
>>>>  echo "Hey from PHP!";
>>>> ?>
>>>>
>>>> It runs fine from a little concurrency. But with "-c 5 -n 500" it
>>>> fails
>>>> after 308 requests!
>>>>
>>>>
>>>>
>>>> Best Regards / Med venlig hilsen
>>>>
>>>> LFWeb
>>>> Lars Nielsen
>>>>
>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>
>>> Have you tried benchmarking from localhost? Do you have any active
>>> firewall? Selinux? Shorewall? Anything that could block a ddos attack?
>>>
>>
>> A firewall is not the case here. He's testing with -c 2 and is getting
>> errors, with -c 50 on a static file not. Also, blocking a DDOS attack
>> at only 50 connections is way too low, so I don't think that would
>> happen.
>>
>> - Matijn
>>
> Now i have the result of a test on localhost:
>
>
> ab -c 1 -n 20 http://localhost/
> 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 localhost (be patient).....done
>
>
> Server Software: Apache/2.2.22
> Server Hostname: localhost
> Server Port: 80
>
> Document Path: /
> Document Length: 14463 bytes
>
> Concurrency Level: 1
> Time taken for tests: 3.540 seconds
> Complete requests: 20
> Failed requests: 0
> Write errors: 0
> Total transferred: 298480 bytes
> HTML transferred: 289260 bytes
> Requests per second: 5.65 [#/sec] (mean)
> Time per request: 177.020 [ms] (mean)
> Time per request: 177.020 [ms] (mean, across all concurrent
> requests)
> Transfer rate: 82.33 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 0 0.0 0 0
> Processing: 175 177 2.1 176 182
> Waiting: 153 156 1.7 155 160
> Total: 175 177 2.1 176 182
>
> Percentage of the requests served within a certain time (ms)
> 50% 176
> 66% 177
> 75% 177
> 80% 178
> 90% 182
> 95% 182
> 98% 182
> 99% 182
> 100% 182 (longest request)
>
> xx@grafikom:/home/xx# ab -c 2 -n 20 http://localhost/
> 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 localhost (be patient)...apr_poll: The timeout specified has
> expired (70007)
> Total of 3 requests completed
>
>
> Does this give any meaning?
>
>
> Med venlig hilsen
>
> LFWeb
> Lars Nielsen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Arghh!!!! :-S

Its an APC issue.... If I turn off php's apc it can handle multiple
connections! ... have to study apc!

Best regards / Med venlig hilsen

LFWeb
Lars Nielsen


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login