Skip to content

28 comments

CFQ. It is designed for desktop use and has been optimized for SSDs where it disables some optimizations that only make sense for rotational media.

6 points

if i admit CFQ and Deadline won't change performance on a high end laptop with standards tasks (i can be wrong), then is there a consumption gain using Deadline, or not ?

0 points

Advantage of CFQ is working ionice.

4 points

This is the reason why I ended up going back to cfq. I spent some time trying other schedulers, and for the most part, I couldn't tell much of a difference. In fact, I wrote that section on how to set the sceduler using a udev rule.

CFQ works perfectly fine, and since it is SSD aware and it allows use of ionice, it is the best choice in my opinion.

I will admit though that it was fun to learn how to use udev to change settings in response to different hardware attributres. So although I ended up back at the default, I still gained something from that experimentation.

1 points

lol. Well, at least you're not getting conflicting answers. /s

3 points

Let the thread living is life and read the votes. :)

2 points

Deadline.

Unless you have some very specific usage patterns.

3 points

Hey all,

i wonder what is the best scheduler for a SSD.

According wikipédia :

  • CFQ

CFQ places synchronous requests submitted by processes into a number of per-process queues and then allocates timeslices for each of the queues to access the disk. The length of the time slice and the number of requests a queue is allowed to submit depends on the I/O priority of the given process. Asynchronous requests for all processes are batched together in fewer queues, one per priority. While CFQ does not do explicit anticipatory I/O scheduling, it achieves the same effect of having good aggregate throughput for the system as a whole, by allowing a process queue to idle at the end of synchronous I/O thereby "anticipating" further close I/O from that process. It can be considered a natural extension of granting I/O time slices to a process.

  • Deadline

The main goal of the Deadline scheduler is to guarantee a start service time for a request.[1] It does so by imposing a deadline on all I/O operations to prevent starvation of requests. It also maintains two deadline queues, in addition to the sorted queues (both read and write). Deadline queues are basically sorted by their deadline (the expiration time), while the sorted queues are sorted by the sector number.

Before serving the next request, the deadline scheduler decides which queue to use. Read queues are given a higher priority, because processes usually block on read operations. Next, the deadline scheduler checks if the first request in the deadline queue has expired. Otherwise, the scheduler serves a batch of requests from the sorted queue. In both cases, the scheduler also serves a batch of requests following the chosen request in the sorted queue.

  • Noop

The NOOP scheduler inserts all incoming I/O requests into a simple FIFO queue and implements request merging. This scheduler is useful when it has been determined that the host should not attempt to re-order requests based on the sector numbers contained therein. In other words, the scheduler assumes that the host is definitionally unaware of how to productively re-order requests.

TL;DR : seems deadline is good for databases and noop for SSD but noop make issues on others process when copying a big file for exemple. Wich one should i use with a SSD: CFQ, deadline or Noop ?

1 points

When using the stock kernel, I prefer deadline. I tried using noop, but it made my desktop freeze sometimes. Otherwise I'm always using bfq.

5 points

With a high end laptop, do you think it would make a difference ? I always wonder before make deep changes on my config because i prefer let it run on vanilla mode if ther's no real improvement.

2 points

Hardware alone probably shouldn't dictate your scheduler choice. It heavily depends on the workload you're processing. noop might be a sensible default since it reduces overhead while the ssd can make unordered requests no big deal, but cfq and deadline can still be just as applicable as before.

seems deadline is good for databases

It depends on what the database is. deadline is hugely skewed towards reads (by default but it can be configured to be biased towards writes). This works well if it's heavy on reads and writing is a relatively exceptional event (like an LDAP directory or a web server's DocumentRoot).

If the DB is heavy on synchronous writes then it could be a worse choice. At the end of the day deadline is about latency guarantees so it may or may not be beneficial to a DBMS that reads a lot of DB/table info into memory.


Of course there's only three options you're interested in. You can install something that monitors disk I/O stats and make the judgment call on your own.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.