# Which cpu and IO scheduler are the "best" for desk

## qnx

Hi, 

using love-sources (mainly because of reiser4) gives an opportunity and possibility to tune your kernel pretty much. From the release info of latest love:

 *Quote:*   

> available options are :  
> 
>  "cpusched=nicksched" - nickscheduler or genetic nickscheduler 
> 
>  "cpusched=staircase" - staircase 10.7 cpu scheduler 
> ...

 

For a long time I've been wondering *which* of these I should use, and which combination will give me the best preforamnce. I have honestly almost no idea about what each of these does so please help me out. Read a bit about Staircase as for CPU scheduler and it seems nice I think, but is it the right way to go for a system with 512 mb ram, athlon xp 2500+, / with reiserfs (not v4). Using as desktop and do some compilation once in a while (new KDEs and such  :Wink: ). Help me out!

----------

## jkt

I'm using vanilla, so I won't recommend you any of alternative CPU schedulers, but CONFIG_IOSCHED_CFQ works great for me.

----------

## mpalencia

I Use love-sources, and I think it depends mostly on your filesystem.

For Example, if you use reiser4, go with genetic anticipatory.

reiser3 and xfs you are better with cfq-ts or deadline and staircase, but I like genetic nicksched better  :Twisted Evil: 

----------

## Deranger

CPU: Staircase

I/O: CFQ-TS

----------

## qnx

Okey, thanks guys!

One more: is there any page that _shortly_ describes the prons/cons of each and the differences between them?

Thanks!

----------

## Phlogiston

 *qnx wrote:*   

> Okey, thanks guys!
> 
> One more: is there any page that _shortly_ describes the prons/cons of each and the differences between them?
> 
> Thanks!

 

same question here...  :Question: 

----------

## nxsty

CPU-schedulers:

ingosched = The standard CPU scheduler from 2.6 mainline written by Ingo Molnar. Has been tweaked a lot to be fast and responsive.

nicksched = Nick Piggins CPU-scheduler. I don't know what's special with this scheduler but some people complained on the LKML about bad gaming performance when it was in -mm. I don't think it differs too much from ingosched.

Genetic nicksched = A version of nicksched that can autotune itself. It might gain you 1% performance at the cost of being unpredictable.

staircase = Con Kolivas CPU-scheduler. Was coded to be fast and responsive by design instead of of tweaks. It usually performce better than the other schedulers in most situations.

zaphod

spa_no_frills

I can't comment on these but check out Peter Williams SF page: http://sourceforge.net/projects/cpuse

IO-schedulers:

anticipatory = The default IO-scheduler.

genetic anticipatory = A version of AS that can autotune itself.

deadline = Supposedly good for database loads.

no-op = No IO-scheduler.

cfq = A IO-scheduler that tries to be completly fair, good for multimedia applications.

cfq timesliced = The new version of cfq that uses timeslices just as the CPU-schedulers. This makes it possbile to set IO priorities.

----------

## Phlogiston

thats nice... thank you!

----------

## fallow

I dont want to comment all . I'll only add something to nicksched comment . 

 *nxsty wrote:*   

> 
> 
> nicksched = Nick Piggins CPU-scheduler. I don't know what's special with this scheduler but some people complained on the LKML about bad gaming performance when it was in -mm. I don't think it differs too much from ingosched. 

 

Id doesnt in mm . In mm is just INGOSCHED + many of multiprocessor especially fixes , especially from Nick Piggin , the maintainer of Nicksched .

 *nxsty wrote:*   

> 
> 
> Genetic nicksched = A version of nicksched that can autotune itself. It might gain you 1% performance at the cost of being unpredictable. 

 

unpredictable ? scheduler behavior will be 100% predictable , base_timeslice and some small parameter to the bonus calculations is only unpredictable here. However NO REASON to USE GENETIC nicksched instead of reguler NICKSCHED . pefrormance increse is a placebo effect.

cheers.

----------

## nxsty

 *fallow wrote:*   

> I dont want to comment all . I'll only add something to nicksched comment . 
> 
> Id doesnt in mm . In mm is just INGOSCHED + many of multiprocessor especially fixes , especially from Nick Piggin , the maintainer of Nicksched .
> 
> unpredictable ? scheduler behavior will be 100% predictable , base_timeslice and some small parameter to the bonus calculations is only unpredictable here. However NO REASON to USE GENETIC nicksched instead of reguler NICKSCHED . pefrormance increse is a placebo effect.
> ...

 

I never said that nicksched was in -mm now. It previously was in several versions but was droped.

----------

## qnx

 *nxsty wrote:*   

> 
> 
> no-op = No IO-scheduler.
> 
> 

 

Sorry, but what do you mean by this?

That there's no IO-scheduler? That the IO-operations are just queued and first when A is completed then B can start? I surely don't get it at all  :Shocked: 

But thanks for the rest of the nice summary anyway!

----------

## nxsty

As I understand it the noop IO-scheduler doesent acctually do any scheduling. It just services the next request in the queue without prefering one request over another.

----------

## _markd

 *qnx wrote:*   

>  *nxsty wrote:*   
> 
> no-op = No IO-scheduler.
> 
>  
> ...

 

no-op scheduler takes the IO requests as they come and hands them to the driver. So it's called no-op because it doesn't really do something. I think it's there because if you do not compile in any of the other *real* schedulers, that you don't end up with an unusable kernel.

----------

## _markd

Benchmarks have shown, that the anticipatory is the best choice in general. It does some statistics on the IO requests is has processed and tries to optimize upcoming requests based on those statistics. With your system the anticipatory scheduler shouldn't be too much overhead.

The IO schedulers are described very good in the german "Linux Magazin" 03/2005 and 04/2005.

You can compile the schedulers as modules and change the scheduler in use at runtime:

- If your hdd is at /dev/hda then you can view available schedulers like this (example from my machine)

```
 

  # cat /sys/block/hda/queue/scheduler

  noop [anticipatory]

  
```

- You can change the IO scheduler like this (example for anticipatory scheduler):

```

  modprobe as-iosched

  

  echo anticipatory > /sys/block/hda/queue/scheduler

  
```

hth

----------

## jkt

 *_markd wrote:*   

> You can compile the schedulers as modules and change the scheduler in use at runtime

 

Thanks a lot for useful tip  :Cool: 

----------

## Illissius

tangential question: anyone know why we have both /proc and /sys, and what the difference is?

----------

## jkt

 *Illissius wrote:*   

> tangential question: anyone know why we have both /proc and /sys, and what the difference is?

 

sysfs has been introduced in vanilla 2.6 (2.5.something actually), proc is older. The problem with proc is, however, that other UNIXes (or some of them) use it only for displaying process-specific infomration (so it contains only /proc/$PID directories). And also entries in sysfs are created differently than under /proc.

Correct me if I'm mistaken.

----------

## qnx

Thanks _markd, veeery useful posts!  :Smile: 

----------

