How to fixed CPU usage for a particular application in linux
Linux - GeneralThis forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I want to fixed maximum CPU usage 20% for OpenOffice writer.Is there a way to do it ? How?
Also is it possible for memory usage?
---
Thanking you
Linux is intended (usually) as a interactive system and as such allocates cpu among tasks as they demand using algorithms that you can read about in the source. AFAIK there is no scheduling algorithm in use in the general purpose Linux distributions that would vary cpu allocations based on the filename associated with an application (and after all in Linux an application name is really just the name of the file you are running). If you want that, the source is available to you and you can make up your own scheduler to control cpu allocation and you can also do whatever you want to control memory usage.
Some of the 'real-time' Linux versions may give you some of what you are looking for.
AFAIK there is no scheduling algorithm in use in the general purpose Linux distributions that would vary cpu allocations based on the filename associated with an application
All distributions use exactly the same kernel.
Quote:
Originally Posted by normscherer
If you want that, the source is available to you and you can make up your own scheduler to control cpu allocation and you can also do whatever you want to control memory usage.
If he knew how to write his own scheduler, he wouldn't be asking this question :)
Quote:
Originally Posted by normscherer
Some of the 'real-time' Linux versions may give you some of what you are looking for.
[/quote]
They all use exactly the same kernel. Except of course embedded systems, which might use a modified ( and of course not easily replaceable ) kernel e.g. the Motorola V3i cellphone.
The new RCU implementation offers cgroups which have memory and cpu allocators. That might be the answer here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.