Error 508 Resource Limit Is Reached

Error 508 occurs due to exceeding the maximum allowed number of simultaneously running Apache processes within the hosting account (Entry Process Limit). A description of the error is available in the official CloudLinux documentation on URL.

With each request to dynamic content, a separate new process is created to process it, and the process counter in the hosting account is increased by one. After the process terminates, the process counter is decremented by one. The maximum number of processes running simultaneously in a hosting account is limited. When processes are created faster than they finish, the process queue fills up and the maximum number of processes limit is reached. If the limit is reached (all available process slots are full), the server cannot create new processes and will return a 508 error for all processes over the limit. The error will be returned until the process queue is unloaded and there are free slots for new processes.

Since the number of processes is counted as a whole for the hosting account, the error can be observed on all sites of the hosting account, even if only one of the sites is the reason for reaching the process limit.

When a 508 error occurs, analyze logs server to determine the types of requests that triggered these processes. The error is often accompanied by Errorlog site with records of the form «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)».

Information on the number of processes in the hosting account is available on the corresponding graphics.

Common causes of the problem:

  • A large number of requests to one or more hosting account sites. For example, due to a DDoS attack or an HTTP flood (frequently sending requests to the same page).
  • Insufficient optimization of site scripts, which is why they do not have time to process all incoming requests in a timely manner with an increase in their number.
  • Suboptimal work of the site with the database. For example, the presence slow queries or lack of indices.
  • Incorrect logic of the site's operation, because of which it does not access its own resources directly, but via HTTP, thereby generating unnecessary requests.
  • If site scripts in the course of their work refer to third-party resources, the reason may be the inaccessibility or long response of these resources. Instead of quickly completing its work, the script has to wait for a response from the remote server, which is why the process takes longer than usual and, with a large number of requests, the process queue can quickly fill up.

Depending on the situation, the following methods of solving the problem may be applied:

  • Determining the source of a large number of requests to the site (by analyzing Accesslogs) and stop it. If the source cannot be stopped, restricting access to the site for him.
  • If a site is experiencing a DDoS attack, enable flood protection or connection services traffic filtering (DDoS protection).
  • Optimization of resource consumption, consumed by the site for the formation of pages. For example, translation to a newer version of PHP, connecting additional services Memcache(d), Redis, OPcache, database structure optimization and requests to her, organization of caching by means of the site itself (installation of caching plugins).
  • Forced termination active processes. This method may not solve the problem, since the source of the appearance of many long-running processes has not been eliminated.
  • If you cannot independently determine the cause and take action, you should report the problem to the developer.

You can also consider the option of switching to one of the tariffs businesshosting with a large Entry Process Limit.