Limit a user with excessive visitor / CPU usage

Freddy

Verified User
Joined
Apr 14, 2016
Messages
153
I have been dealing with this question more often lately. I have a server with enough resources to serve several domains with ease. But lately, anonymus crawlers/scrapers with a huge amount of IP addresses are visiting one single domain. There is no simple way of blocking them. They originate from many different countries, provide normal user agents and are nowhere near any rate limiting value because each hit is from a different IP address.

My server is down on his knees in CPU usage and and is loading very slow on all domains. I have tried Resource limits but the only working limit would be the CPU usage. And limiting CPU usage on a server with many visitors is creating it's own problems. Visitors will queue up until apache runs out of workers and the whole server stops working. So no, CPU limiting is not an option. But what is?

I don't really care if the victim domain becomes unresponsive when this happens, but the problem is that the other domains on the same server also suffer. Is there any way to limit this single user/domain so it won't take down the rest of the server without moving the domain to a separate server to host a single domain?
 
You need complex limits: cpu, mysql limit connections, if you run php-fpm - max workers, also you can limit total user-owned processes.
 
You need complex limits: cpu, mysql limit connections, if you run php-fpm - max workers, also you can limit total user-owned processes.

CPU limit doesn't work like I mentioned. MySQL connections aren't the problem.
Can I set a max workers per user? Limiting the user-owned processes doesn't work because it's always the same.
 
Are these forums by any chance? Because for several forums like phpBB and Xenforo there are good working counter measures for these kind of scraping attacks.
No, not a forum. It's a job-site made in Wordpress. The filters for searching the jobs create unique url's so bots go crazy on url's while the site is serving a lot of duplicate content.
 
Back
Top