LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux 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



Reply
 
Search this Thread
Old 10-21-2009, 08:13 AM   #1
megerdin
Member
 
Registered: Jul 2007
Location: London
Distribution: FC11,FC10,FC7,FC4,Centos 5.1,Ubuntu,Mandrake Linux,puppy.LinuxMint.Opensuse
Posts: 181

Rep: Reputation: 31
How to fixed CPU usage for a particular application in linux


Just think,

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
 
Old 10-21-2009, 07:02 PM   #2
normscherer
Member
 
Registered: Sep 2005
Location: On the road
Distribution: Ubuntu 8.10
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by megerdin View Post
Just think,

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.
 
Old 10-22-2009, 03:00 AM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Some combination of ulimit http://linux.die.net/man/1/ulimit and nice http://linux.die.net/man/1/nice
 
Old 11-01-2009, 01:42 AM   #4
DJ Shaji
Member
 
Registered: Dec 2004
Location: India
Distribution: Debian Squeeze, Fedora 17
Posts: 440
Blog Entries: 15

Rep: Reputation: 80
maybe cgroups

Quote:
Originally Posted by normscherer View Post
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 View Post
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 View Post
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.

See the kernel documentation.
 
Old 11-01-2009, 01:56 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,497

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Not the easiest to set up but works fine.
 
  


Reply

Tags
application, cpu, fixed, how, linux, particular, usage


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multithreaded application, CPU and memory usage mohitanchlia Linux - General 6 08-30-2010 11:13 AM
processes/CPU Usage/Mem Usage desktop wallpaper ceantuco Linux - Newbie 2 04-13-2009 02:14 PM
CPU usage constantly at 100% due to application-browser and gnome-panel Perps Suse/Novell 1 05-14-2007 11:55 AM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 09:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 05:45 AM


All times are GMT -5. The time now is 01:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration