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
|