How to Fix "Resource Limit Is Reached" (508) Errors on CloudLinux

What the 508 page means on a CloudLinux server, how to prove it is the EP limit with lveinfo, the five common causes, and when raising the limit is right.

Published
Reading time
4 min

A site on a CloudLinux server starts answering with a plain white page that says "Resource Limit Is Reached", status 508. It comes and goes, every other site is fine, and the customer wants to know why they are being singled out. This post explains what actually triggers that page, how to prove which limit is involved, and how to fix the cause rather than just raising the number.

What a 508 actually means

508 is not a PHP error and not Apache falling over. It is the response the LVE gives when a new request arrives for a user whose entry-process limit (EP) is already full. EP counts the requests running inside that user's LVE at one moment: each PHP request holds one slot from the moment it starts until it finishes. With the default EP of 20, the 21st simultaneous request is refused with a 508 rather than queued.

Two things follow. The site is not necessarily busy: 20 slots are just as full when 20 requests are each taking ten seconds as when 20 arrive in the same second. And 508 is the only limit that produces this page. CPU throttling slows a site down silently, a memory fault kills the process and shows as a 500 or a blank page, and NPROC faults show as fork errors. If the page says 508, it is EP.

Confirm it with lveinfo

The LVE statistics record every fault, so there is no need to guess:

bash
lveinfo --period=1d --by-fault=any --show-columns=ID,aCPU,mEP,EPf,PMemF,NprocF
lveinfo --period=6h --user=bob -d

EPf is the number of entry-process faults, mEP the highest concurrent count reached. A user with EPf in the hundreds and mEP sitting at the limit has hit it hard. If EPf is zero, the page is coming from somewhere else, most likely a proxy in front of the server, and the domain's error log is the next stop. lveps shows the same picture live, one LVE per line. In DirectAdmin the Statistics tab of CloudLinux Manager (Admin Level → Extra Features → CloudLinux Manager) has the same numbers with faults highlighted, and Current Usage shows the live picture. Reading LVE statistics covers the columns in detail.

The five usual causes

1. Bots and crawlers. The most common. A scraper hitting search and archive URLs will happily open 30 connections at once, each executing PHP. Count the requesters in the access log:

bash
awk '{print $1}' /var/log/httpd/domains/example.com.log | sort | uniq -c | sort -rn | head

Block the offender in CSF or .htaccess, and add a robots.txt rule for the crawlers that read it.

2. xmlrpc.php. WordPress only. Password guessing through XML-RPC arrives as thousands of small POSTs and fills EP with no real traffic. Unless the site needs Jetpack or a mobile app, deny access to xmlrpc.php in .htaccess.

3. wp-cron.php. WordPress fires wp-cron.php from page views, so on a busy site every visit can spawn a second request for scheduled tasks. Set DISABLE_WP_CRON to true in wp-config.php and run it from a real cron job every five minutes instead, with the user's PHP binary, as in cron jobs in DirectAdmin.

4. Slow PHP. A request that takes eight seconds holds a slot for eight seconds. A plugin waiting on an external API, a query without an index or a 20 MB autoloaded options table turns a modest site into a 508 site. X-Ray tells you which one.

5. No caching. Without a page cache, every visit runs the full PHP stack. With one, most visits are served from a file in milliseconds and never occupy a slot for long. On Shared Pro, AccelerateWP turns this on per site; otherwise any decent cache plugin does.

Work through them in that order: bots and XML-RPC are ten-minute fixes, caching is an hour, slow PHP needs investigation.

When raising EP is the right answer

Raise it when the site is genuinely busy, already cached, not being crawled to death, and still hits the limit: a shop on a sale day, a news site after a big link. Raise it for that user, not for the default:

bash
lvectl set bob --maxEntryProcs=40 --save-all-parameters
lvectl list

Keep the increase modest. EP protects the server, not just the site; a user with EP 200 and a slow site can hold 200 Apache workers and starve everyone else. A customer who needs EP above 50 day after day has outgrown a shared account and belongs on a bigger package or a VPS, which is a better conversation than raising the limit again next month.

Other limit symptoms and their fixes

Out of memory. The PMemF column, and "Out of memory" or "Cannot allocate memory" in the domain's error log: the user's processes together exceeded PMEM and one was killed. Image processing and backup plugins are the usual suspects; raise PMEM from 1G to 2G if the workload is legitimate.

Fork failures. "fork: Resource temporarily unavailable" or "Cannot fork" means NPROC. Cron jobs and SSH sessions count too, so a script spawning children in a loop, or a backup running while the site is busy, will do it.

Slow with no error. aCPU sitting at the SPEED limit means CPU throttling. Nothing fails, everything crawls. Cache first, then X-Ray, and only then more SPEED.

Slow uploads, backups and imports. IOf faults: the account is held to its IO limit, usually by a backup plugin writing gigabytes.

Tell the customer before they tell you

Options → Notifications in CloudLinux Manager emails you, and optionally the user, when an account's faults pass a threshold you set. Turn it on. A 508 you spot from the notification and fix the same afternoon is a support win; one reported by the customer three days later is not. On a VPSPioneer managed VPS we can convert the server to CloudLinux and set these notifications up as part of the service.

#cloudlinux#lve#508#troubleshooting

Keep reading

More from CloudLinux

All guides

CloudLinux

Read CloudLinux LVE Statistics and Find the Account Slowing the Server

How to use lveps, lveinfo, lvechart and the CloudLinux Manager tabs to find which account is hitting its limits, what each fault means, and what to do next.

5 min read →

CloudLinux

What CloudLinux Does for Shared Hosting Stability (and Why It Matters)

How CloudLinux keeps one busy account from slowing a shared server: LVE limits, CageFS, PHP Selector, what a 508 error means and how to stay within limits.

6 min read →

CloudLinux

How to Set LVE Limits: SPEED, PMEM, IO, IOPS, NPROC and EP

What each CloudLinux LVE limit means, worked starting values for three package tiers, the lvectl commands, and when to raise a limit or move a customer up.

5 min read →