httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <tevans...@googlemail.com>
Subject Re: [users@httpd] Too many vhosts?!?!
Date Mon, 06 Oct 2014 13:06:38 GMT
On Sun, Oct 5, 2014 at 9:22 PM, Jakov Sosic <jsosic@gmail.com> wrote:
> Hi guys.
>
> I'm running CentOS 6 with latest httpd (2.2.15-31.el6).
>
>
> I've noticed a very peculiar problem with Apache. I have a very high number
> of virtual hosts set up - it's around 501.
>
> Problems started occuring after vhost number 493. First 493 vhosts work as
> expected, but as soon as I add vhost number 494, PHP stops communicating
> with memcache, and it times out on every read/write access.
>
> Actually, I'm using memcache as a backend sessions store, so, php function:
>
> session_start();
>
> simply times out after 30 sec.
>
> If I delete the random one of the 494 vhosts and restart apache, it starts
> working again.
>
> I've set ulimit really high (65k) but it doesn't help. I've tried switching
> off ulimits completely, but no luck.
>
> Do you guys have any ideas what more could I try?
>
> I've tried stracing the httpd process to which I'm connected to, after I hit
> the enter in browser and after 30 sec wait commences.
>
> This is the strace output:
>
> select(1170, [1024 1169], [], NULL, {1, 0}) = 2 (in [1024 1169], left {0,
> 999998})
> select(1170, [1024 1169], [], NULL, {1, 0}) = 2 (in [1024 1169], left {0,
> 999998})
> select(1170, [1024 1169], [], NULL, {1, 0}) = 2 (in [1024 1169], left {0,
> 999998})
> select(1170, [1024 1169], [], NULL, {1, 0}) = 2 (in [1024 1169], left {0,
> 999998})
> select(1170, [1024 1169], [], NULL, {1, 0}) = 2 (in [1024 1169], left {0,
> 999998})
>
> So basically apache is stuck on select(), and that's it, it repeats the
> select() system call indefinitely.
>
>
> More info (including GDB output) on:
>
> http://serverfault.com/questions/633216/apache-stops-communicating-with-memcache-after-creating-too-many-vhosts
>
>
> The most difficult part is that I cannot reproduce this specific error on
> another hardware, so it's some kind of apache-linux-hw combo...
>
>
>
> Do you have any ideas what can I do to debug the issue further?
>

Why do you think it has anything to do with httpd? This is firmly a
"When I do things with PHP, PHP doesn't work .... therefore httpd has
a problem" type diagnosis.

The first thing I would suggest is asking on a PHP list why using a
memcached session backend stops working with large numbers of clients.

The second thing I would suggest is not running mod_php (I am
assuming; you don't mention, but you are stracing httpd to see PHP's
select()s...) but run php-fpm, which separates out PHP from httpd. It
also performs a lot better.

Cheers

Tom

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


Mime
View raw message