LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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

Tags used in this thread
Popular LQ Tags , , , , , , , , ,

Reply
 
Thread Tools
Old 10-21-2009, 08:13 AM   #1
megerdin
Member
 
Registered: Jul 2007
Location: Bangladesh/Sylhet
Distribution: FC11,FC10,FC7,FC4,Centos 5.1,Ubuntu,Mandrake Linux,puppy.LinuxMint.Opensuse
Posts: 173
Thanked: 1
How to fixed CPU usage for a particular application in linux


[Log in to get rid of this advertisement]
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
linuxfedora megerdin is offline  
Tag This Post , , , , , , , , ,
Reply With Quote
Old 10-21-2009, 07:02 PM   #2
normscherer
Member
 
Registered: Sep 2005
Location: On the road
Distribution: Ubuntu 8.10
Posts: 39
Thanked: 0
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.
linuxubuntu normscherer is offline     Reply With Quote
Old 10-22-2009, 03:00 AM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 5.4
Posts: 7,411
Thanked: 324
Some combination of ulimit http://linux.die.net/man/1/ulimit and nice http://linux.die.net/man/1/nice
windows_xp_2003 chrism01 is offline     Reply With Quote
Old 11-01-2009, 01:42 AM   #4
DJ Shaji
Member
 
Registered: Dec 2004
Location: Zootopia
Distribution: Fedora Core 4
Posts: 69
Thanked: 2
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.
linux DJ Shaji is offline     Reply With Quote
Old 11-01-2009, 01:56 AM   #5
syg00
Guru
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 6,908
Thanked: 165
Not the easiest to set up but works fine.
syg00 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
processes/CPU Usage/Mem Usage desktop wallpaper ceantuco Linux - Newbie 2 04-13-2009 02:14 PM
Multithreaded application, CPU and memory usage mohitanchlia Linux - General 5 02-17-2009 11:18 AM
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 04:04 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration