1

I am running some python scripts in my linux terminal that happen to be pretty resource intensive, but when I do my system will become pretty non-responsive until the process has completed. I know there are commands like nice and cpulimit but I haven't found a great way to just open a terminal that is somehow resource limited (and what percentage of resources can be devoted to it) and can be used to run any scripts during that particular session.

So is there a good way to do this?

1 Answer 1

3

You can use setrlimit() from Python's built-in resource library to manage resource limits within your Python scripts.

Alternatively, the setup you describe in your question sounds most like running a virtual machine (e.g. VirtualBox or VMware). You can specify what resources you want to allow your VM to use, then you can run whatever you want in there and have it quarantined from the rest of your system's resources.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.