Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Some processes spend most of their "lives" in a sleep status. Daemons, servers and general listener come to mind. I was wondering if they get the same CPU time in that state? On something like my laptop, that wouldn't be very optimal!

I vaguely remember from my operating system course that there are different approaches to scheduling. I am interested to find out more about my current Linux (Debian) box.

How can I find out about my current scheduling policies? Can I change them dynamically? With a pretty userland app?

share|improve this question
up vote 9 down vote accepted

Processes do not consume CPU resources while they are sleeping. They may add some overhead since the Kernel has to juggle them around, but that is very insignificant.

However, because of the way the question is worded, I should mention that when using Linux's CFS (Completely Fair Scheduler), it attempts to give programs increased CPU time in proportion to the time it sleeps - that is, if a process sleeps a lot, when it is resumed, it gets a higher priority.

See http://www.ibm.com/developerworks/linux/library/l-completely-fair-scheduler/ for a description of CFS.

share|improve this answer
I want to vote this answer up but your current rep score (6,666) is too pretty to change. Ah well, I'm doing it anyway... – rahmu Oct 19 '11 at 14:37
@rahmu noooo! My beautiful straight sixes! I'll just have to get to sevens now. – Shawn J. Goff Oct 19 '11 at 14:40

By definition, a sleeping process is not executing on the cpu, so obviously the amount of cpu time it is using is zero.

share|improve this answer

Your Answer


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.