LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-27-2005, 12:16 AM   #1
BatGeorgeone
LQ Newbie
 
Registered: May 2004
Location: Birmingham, UK
Distribution: Slackware 10.0
Posts: 3

Rep: Reputation: 0
Limitation of processor and memory usage


Hello there,

first of all, excuse my poor and bad English, plz ;-)

How , i can limit the processor usage and memory usage of a particular process.
An example, i want to import a back up dump file of MySQL DB, so the sql file is abt 30 MB big, not such a big deal but when i try to import it with mysql -u root -p -h localhost -D DBname < backupfile.sql , this process just takes all the cpu time and memory maybe i am not sure. So my PC which has 512 ram and 2,8 Ghz cpu, just freezes for more than 2 hours... The fan is going mental the HDD activity light is permanently on during that time. The PC is just unusable for 2 h's , ti just can't afford that to happen on my hosting sever, where i am ment to import this back up sql file.

I did read abt "ulimit" command but it seems to limit just the number ot processes not their priority, i have seen "man nice" as well but the problem is how would i know the ID of a fiture process so I can put it in a nice command, or how can start these mysql and nice processes at simultaneously so nice to be able to limit the greedy "mysql " import process?

I hope i made my self clear ;-) , so please could you give me any clues or solution ??

Regards
George
 
Old 07-27-2005, 12:50 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
30MB or do you mean 30GB? Cause if it takes 2 hours to dump a 30MB file, I'd seriously start considering you have hardware problems..
 
Old 08-16-2005, 04:17 PM   #3
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Rep: Reputation: 31
Regardless of whether it's 30 MB or 30 GB, is it possible to limit the memory and cpu usage or a process? I remember reading somewhere that there was a kernel patch that could give you this functionality but was wondering if there's a workaround to this problem without recompiling the kernel. Thanks for your time.
 
Old 08-16-2005, 11:36 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
try doing

nice -n 19 <yourCommand>
 
  


Reply



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
Memory limitation for user process SwannAnderson Linux - Software 1 10-02-2005 08:12 PM
cpu and memory limitation for users? tiee Linux - General 3 11-16-2004 04:02 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Memory management limitation jack1234 Linux - Newbie 2 03-11-2004 01:35 PM
Memory limitation Magnus Linux - General 2 01-18-2001 07:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:31 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
Open Source Consulting | Domain Registration