Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

On an ubuntu box with 4GB, I am running apache with some mpm + mysqld. Furthermore, there is a postfix, mongod and ocassionaly some imagemagick/convert processes active.

On 99% of the days, that's fine. However, sometimes (not at peak times, but e.g. at 3am in the morning - although backup process start few hours late) the server runs out of RAM. Then it's killing processes and unfortunately it's starting with apache and/or mysqld :-(

Do I have a chance to define which process is "important" or high-priority? E.g. i'd define 1) apache 2) mysql 3) postfix 4) convert 5) mongod <- as far as i know, mongod is very polite and will release ram for other applications if needed.

Btw. the system is not running out of memory because of ghost processes; i use some cleaner scripts which make sure that unused ram is recycled :-)

Thx

share|improve this question

1 Answer

Well, in System Monitor you can simply assign a priority via right-clicking a process and choosing change priority. If you don't have a GUI running, you should use the command renice, just check out the manpage.

share|improve this answer
Hi, Thanks for reply. Are you sure that ubuntu respects the nice level when shutting down a process to release required memory? I thought it was already "priorized" in this way and wonder if ubuntu is following the rules... – ledy Jun 18 '12 at 11:08
@ledy Processes with lower nice levels are not necessarily more important; they're just intended to get more CPU time. For example, pulseaudio runs with a far lower nice level than init, but the consequences of killing init are almost always far more severe than then consequences of killing pulseaudio. – Eliah Kagan Jun 18 '12 at 11:23
@Eliah Kagan: Does the nice level only target the cpu behaviour? No effect when OS is killing because of low memory/ram available? – ledy Jun 18 '12 at 12:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.