I am curious if it is possible artificially modify the server load in Ubuntu or more generally linux. I am working on an application that reacts to the server load, and in order to test it it would be nice if I could change the server load easily.
I am currently running an over-active program that will literally generate load, but I’d prefer to not continue overheating my laptop (it’s getting hot!).
Use
chrootto run the various pieces of software you’re testing with a specified directory as the root directory. Set up a manufactured/modified /proc/loadavg relative to that new root directory, too.chrootwill let you create a dummy file that appears to have /proc/loadavg as its path, so the software will observe your manufactured values even if you can’t change your code to look for load data in a different location.