This is the situation:I have a PHP/MySQL web application that does some PDF processing and thumbnail creation. This is done by using some 3rd party command line software on the server. Both kinds of processing consume a lot of resources, to the point of choking the server. I would like to limit the amount of resources these applications can use in order to enable the server to keep serving users without too much delay, because now when some heavy PDF is processed my users don't get any response.Is it possible to constrain the amount of RAM and CPU an application can use (all processes combined)? Or is there another way to deal with these kinds of situations? How is this usually done?
How to constrain the resources an application can use on a linux web server
linux;process;process management;limit;resources
Run it with nice -n 20 ionice -c 3That will make it use the remaining CPU cycles and access to I/O not used by other processes.For RAM, all you can do is kill the process when it uses more than the amount you want it to use (using ulimit).