One website using all Apache slots on server
One of the websites hosted on my server has a problem, keeping all PHP threads stuck. Meanwhile, more people connect to the server and wait. The problem is, at a certain point, there are so many Apache connections waiting for a response for this site that it causes all other sites to stop receiving connections. Even increasing the Apache parameters and reducing the default timeout, the problem persists.
How do I configure it so that a single site can't use all Apache slots? I need to adjust some limit so that the website with a problem, even though it has many hits, does not impact other websites on the server.
From Apache Status
237 requests currently being processed, 5 idle workers
WWWWWWGWWGWWGGWGGWGWGGGGGGWWWWWWWWWWWGWGWWGGGGGGGGWWGGGGGGGGGGGG
GGGGGGGGGGGGGGWGGGGGGWWGGWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWCWWWWW_WWWWWWWWWWWWWW_C___W
R.....
From top:
PID USER %CPU %MEM TIME+ COMMAND
3377072 siteuser 0.0 0.3 0:02.60 php-fpm
3377127 siteuser 0.0 0.3 0:03.37 php-fpm
3377256 siteuser 0.0 0.3 0:01.26 php-fpm
3377309 siteuser 0.0 0.3 0:01.52 php-fpm
3372372 siteuser 0.0 0.2 0:00.09 httpd
3372374 siteuser 0.0 0.1 0:01.28 httpd
3372405 siteuser 0.0 0.1 0:00.06 httpd
3372406 siteuser 0.0 0.1 0:00.05 httpd
3372425 siteuser 0.0 0.1 0:00.04 httpd
3372426 siteuser 0.0 0.1 0:00.06 httpd
3372429 siteuser 0.0 0.1 0:00.04 httpd
3372430 siteuser 0.0 0.1 0:00.05 httpd
3372432 siteuser 0.0 0.1 0:00.07 httpd
3372433 siteuser 0.0 0.1 0:00.03 httpd
3372435 siteuser 0.0 0.1 0:00.06 httpd
3372460 siteuser 0.0 0.1 0:00.04 httpd
3372744 siteuser 0.0 0.1 0:00.02 httpd
3372748 siteuser 0.0 0.1 0:00.02 httpd
3372763 siteuser 0.0 0.1 0:00.02 httpd
3372770 siteuser 0.0 0.1 0:00.02 httpd
3372771 siteuser 0.0 0.1 0:00.02 httpd
3373339 siteuser 0.0 0.1 0:00.03 httpd
3373405 siteuser 0.0 0.1 0:00.03 httpd
3373409 siteuser 0.0 0.1 0:00.02 httpd
3373410 siteuser 0.0 0.1 0:00.02 httpd
3373411 siteuser 0.0 0.1 0:00.01 httpd
3373415 siteuser 0.0 0.1 0:00.02 httpd
3373416 siteuser 0.0 0.1 0:00.01 httpd
3373417 siteuser 0.0 0.1 0:00.02 httpd
3373418 siteuser 0.0 0.1 0:00.03 httpd
3373419 siteuser 0.0 0.1 0:00.04 httpd
3373422 siteuser 0.0 0.1 0:00.03 httpd
3373578 siteuser 0.0 0.1 0:00.01 httpd
3373618 siteuser 0.0 0.1 0:00.03 httpd
3373627 siteuser 0.0 0.1 0:00.02 httpd
(...)
-
It's not free, but you could look at CloudLinux. You can limit entry points (effectively http(s) connections) per account and if they exceed, the visitor will get a 508 error. 0 -
Thank you for the answers. For now I fixed using a bash script. It's not the best solution but fix this issue. [QUOTE]#!/bin/bash q=$(ps -U siteuser | wc -l) if [ "$q" -gt "100" ]; then killall -u siteuser /usr/sbin/httpd fi 0 -
You should also consider using LiteSpeed instead of Apache. LiteSpeed can scale to meet the demand much better than Apache while using a lot less system resources. 0
Please sign in to leave a comment.
Comments
4 comments