2.4.3.7. Error 508 Resource Limit Is Reached
Attention!
The number of processes is counted for the hosting account as a whole, without division by sites. Therefore, even if the reason for reaching the process limit is only one site, the error will occur on all sites of the hosting account.About the error
Error 508 occurs due to reaching the limit of simultaneously running processes within the hosting account (Entry Process Limit). Information about the limit is available in official CloudLinux documentation.
When each request for dynamic content is processed in the hosting account, a new separate process is created and the process counter is incremented. When the process finishes its work, the counter decreases. The maximum number of concurrently running processes is limited. If new processes are created faster than old processes are terminated, the process queue fills up and the maximum number of processes limit is reached. When the limit is reached, the server cannot create new processes and returns a 508 error for all processes over the limit. The error will be returned until the process queue is unloaded and there are no free slots for new processes.
When error 508 occurs, it is recommended to analyze access logs of the sites in the hosting account and try to determine what requests may have triggered these processes. The error is often accompanied in error logs of the sites by entries like "LVE enter: LVE(XXX) HANDLER(XXX) HOSTNAME(XXX) URL(XXX) TID(XXX) errno (7) Read more: https://www.hosting.xyz/wiki/hosting/errors/508/#MHL-E2BIG min_uid (XXX)".
Common causes
- Lack of CPU and RAM resources. If there are not enough free resources in the hosting account, processes run slower, which leads to queue filling and error 508.
- Large number of requests to the site. For example, due to a DDoS attack or HTTP flooding (frequent requests to the same page).
- Insufficient site optimization. The site scripts do not have time to process all incoming requests in a timely manner as their number increases.
- The site does not work optimally with the database. For example, the presence of slow queries, lack of indexes, etc.
- Incorrect site logic. For example, the site scripts access the resources of the same site not directly, but via HTTP, thus generating unnecessary requests.
- Outgoing connections. If site scripts are accessing third-party resources during their work, this may be due to unavailability or long response time of these resources. Instead of finishing its work quickly, the script has to wait for a response from the remote server, which causes the process to run longer than usual and may cause the process queue to fill up quickly with a large number of requests.
Possible solutions
- First of all, check the diagrams in the "Web server load" section. If a heavy load is noticed, try to find out and eliminate its causes (see Analyze the causes of high consumption of resources).
- Check the site access logs and see where the most requests are coming from. If the most requests are coming from some unknown third-party IP addresses, you can restrict access to the site.
- In case of a DDoS attack, you can enable flood protection or connect traffic filtering services (DDoS protection).
- Consider optimizing scripts and internal site logic so that page generation requires fewer resources. It may help to change PHP version to a newer one, connect extra services Memcache(d), Redis, OPcache, optimization of the database structure and queries to it, organization of caching by means of the site itself (installation of caching plugins).
- Active processes can be forcibly terminated. This may help for a while, although it will not solve the problem completely if the source of many long-running processes is not eliminated.
- If it is not possible to determine the cause and take action on your own, you should report the problem to the site developer.
You can also consider switching to one of the business hosting plans with a higher Entry Process Limit.
Comentários