When being inside a CloudLinux OS Lightweight Virtual Environment (LVE) environment, it would be useful to be able to detect if having reached the system resource quota. Is that possible? Our desire is to adapt to infrequent overload by serving static error messages rather than failing to present dynamically created data.
Any links to API documentation would be most welcome, but I doubt there are any publicly available. The limits documentation suggests there should be a number of command line utilities, as well as a
/proc/lve/list file. It seems however that (in the environment we have access to), there are no cli tools installed and the only file available in
/proc/lve is (the seemingly also undocumented)
$ uname -r
There are a couple of files in
/usr/include/lve. Can they be used as user? or are they merely intended for administration of LVE? From the function names one can guess that
lve_check_fault() would be intended precisely to detect overuse from within a limited environment. However calling the
0 suggesting no features of the library are available. Monitoring the system calls shows that the crucial failures are attempts to open the non-existent
Our hosting provider's first suggestion is to use cPanel's REST API. Something which seems too heavy and too slow to be useful for mitigating an overload situation as it happens.
With our circumstances it is not relevant to scale to allow using more resources during these infrequent peaks. Gracefully handling the situation rather than dropping requests is the appropriate change.