Author Topic: Default Scheduler Deadline for SSD?  (Read 1256 times)

Offline kah5683

  • Sr. Member
  • ****
  • Posts: 307
Default Scheduler Deadline for SSD?
« on: February 17, 2012, 02:45:01 PM »
I have read that to optimize an SSD drive it is a good idea to change the default scheduler from cfq to deadline.

http://crunchbanglinux.org/forums/topic/13129/howto-optimize-linux-for-use-with-a-solid-state-drive/

1.  Is there reason NOT to do this on just my SSD drive?
2.  How do I do it?

Thanks!
P8Z68-V Pro/Gen3 Motherboard - onboard soundcard
Intel i5-2500K Processor 3.3 GHz 4 core
Nvidia GeForce GTX550Ti Graphics card
60gb Patriot SSD - 2tb Seagate HDD - 8gb RAM
PCLinuxOS-KDE-2012-02

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Default Scheduler Deadline for SSD?
« Reply #1 on: February 17, 2012, 05:17:16 PM »
I have read that to optimize an SSD drive it is a good idea to change the default scheduler from cfq to deadline.

http://crunchbanglinux.org/forums/topic/13129/howto-optimize-linux-for-use-with-a-solid-state-drive/

1.  Is there reason NOT to do this on just my SSD drive?

No, it is safe, you can only affect disk I/O performance, eventually you can revert back at any time.

Quote
2.  How do I do it?

LOL  :D Did you read the article form your own link ?

Quote
Thanks!


Welcome!  ;)

AS

Offline kah5683

  • Sr. Member
  • ****
  • Posts: 307
Re: Default Scheduler Deadline for SSD?
« Reply #2 on: February 17, 2012, 08:34:39 PM »
AS:

The reason I posted was because I really didn't understand what to do in that section of the article with changing the default scheduler from cfq to deadline.  It looks like the first fix is only until shutdown/reboot, and the second was more permanent.  With the second, I couldn't find the 10_linux file and I'm not sure on updating the grub.

I was hoping for a more straightforward procedure that I can understand so I can get this done.  Even though I may have been around a little while, I only know enough to be a little dangerous.  Those instructions were over my head.
P8Z68-V Pro/Gen3 Motherboard - onboard soundcard
Intel i5-2500K Processor 3.3 GHz 4 core
Nvidia GeForce GTX550Ti Graphics card
60gb Patriot SSD - 2tb Seagate HDD - 8gb RAM
PCLinuxOS-KDE-2012-02

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Default Scheduler Deadline for SSD?
« Reply #3 on: February 17, 2012, 09:35:41 PM »
AS:

The reason I posted was because I really didn't understand what to do in that section of the article with changing the default scheduler from cfq to deadline.  It looks like the first fix is only until shutdown/reboot, and the second was more permanent.  With the second, I couldn't find the 10_linux file and I'm not sure on updating the grub.

I was hoping for a more straightforward procedure that I can understand so I can get this done.  Even though I may have been around a little while, I only know enough to be a little dangerous.  Those instructions were over my head.

Sorry, overlooked your question, I was thinking you was aware of what you were going to do.

What's an IO scheduler: it's the implementation of a strategy to read/write data on some device: when an application perform some write operation, data are not immediately written on the disk but instead data are stored on RAM buffers. (this is also the cause of data loss in case of crash/power failure), The kernel as shipped on PCLinuxOS provide tree different scheduler each one implement a different strategy, and depending on the real work, one scheduler may perform better than the other.

When it is important to choose the right scheduler ? when the overall I/O performance may benefit from using a different strategy.
I repeat the above, you may benefit from one IO scheduler instead of another one, when your applications are bound to disk I/O performance, which is often the case for "servers" but it is rarely the case for "desktops" like PCLinuxOS.

There are other things to consider, changing I/O scheduler may not provide the desired result if you are not going to change other parameters, in the end "tuning I/O performance" it's not a matter of only change a couple of parameters.

There are a lot of factors that affect IO performance, nearly always when you increase the performance you will increase the risk of data loss in case of crash.

Going "extreme", i could suggest to sync the data on disk every 5 minutes, this will reduce drastically the write operations, at price of increased RAM usage and a greatly increased risk of data loss, probably something you don't want.

Do you need to really gain some minutes of life for your SSD ? You will need to apply the change "elevator=deadline" appending the parameter to the end of the boot line
in file /boot/grub/menu.lst:

Quote
title linux
kernel (hd0,0)/vmlinuz BOOT_IMAGE=linux root=UUID=5dcafa5b-be66-42da-b048-74e175777339 acpi=on vga=791 elevator=deadline
initrd (hd0,0)/initrd.img

 ;)

AS
« Last Edit: February 17, 2012, 09:42:43 PM by AS »

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11577
  • ----IOFLU----
Re: Default Scheduler Deadline for SSD?
« Reply #4 on: February 17, 2012, 11:31:54 PM »
kah5683:

I know you've seen this, because it was in answer to your question. Re read it, and pay attention this time. All the crap you read in the link you posted is basically bogus, and was outdated before the blog was written . All that alignment crap has been taken care of automatically since all the partitioning tools for Linux were rewritten to do so. You can use a regular DOS partition table, rather than a GUID partition table. GUID is one alternative for drives having greater than 2 TB capacity. Your SSD certainly isn't in that category.

http://www.pclinuxos.com/forum/index.php/topic,102658.msg875792.html#msg875792

While not a SSD drive, note that using a DOS partition table on a 2 TB Green hard drive, without any special attention paid to alignment, the first sector of the first partition is automatically placed in correct alignment for the 4 KB sector size, using sector 2048 as its beginning.

[root@fatman ~]# fdisk -l /dev/sdc

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x18eee7ae

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048     2099199     1048576   83  Linux
/dev/sdc2         2099200    18876415     8388608   82  Linux swap / Solaris
/dev/sdc3        18876416    81790975    31457280   83  Linux
/dev/sdc4        81790976  3907029167  1912619096    5  Extended

This is now the default used for partitioning all hard drives of all sizes, for the sake of simplicity and consistency. While not needed for most drives, it does no harm where it's not strictly required, and for those drives that absolutely require it, it is the default, so no extra precautions or procedures are required.

The legacy grub that PCLinuxOS uses works just fine with drives partitioned in this manner. There is no need to use grub2, which is still under development, and according to its own developers, not yet ready for use on production systems.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline MCP

  • Sr. Member
  • ****
  • Posts: 371
Re: Default Scheduler Deadline for SSD?
« Reply #5 on: February 20, 2012, 08:03:19 PM »
kah5683:

I know you've seen this, because it was in answer to your question. Re read it, and pay attention this time. All the crap you read in the link you posted is basically bogus, and was outdated before the blog was written . All that alignment crap has been taken care of automatically since all the partitioning tools for Linux were rewritten to do so. You can use a regular DOS partition table, rather than a GUID partition table. GUID is one alternative for drives having greater than 2 TB capacity. Your SSD certainly isn't in that category.

http://www.pclinuxos.com/forum/index.php/topic,102658.msg875792.html#msg875792

While not a SSD drive, note that using a DOS partition table on a 2 TB Green hard drive, without any special attention paid to alignment, the first sector of the first partition is automatically placed in correct alignment for the 4 KB sector size, using sector 2048 as its beginning.

[root@fatman ~]# fdisk -l /dev/sdc

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x18eee7ae

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048     2099199     1048576   83  Linux
/dev/sdc2         2099200    18876415     8388608   82  Linux swap / Solaris
/dev/sdc3        18876416    81790975    31457280   83  Linux
/dev/sdc4        81790976  3907029167  1912619096    5  Extended

This is now the default used for partitioning all hard drives of all sizes, for the sake of simplicity and consistency. While not needed for most drives, it does no harm where it's not strictly required, and for those drives that absolutely require it, it is the default, so no extra precautions or procedures are required.

The legacy grub that PCLinuxOS uses works just fine with drives partitioned in this manner. There is no need to use grub2, which is still under development, and according to its own developers, not yet ready for use on production systems.


Just so that I'm clear on this as well.  Since most of the older info is out of date as you mention.  What tweaks are absolutely needed and what is to be avoided?  I've read that you shouldn't put your home or tmp directories on the ssd as this will wear it out.  But as Parnote pointed why wouldn't you want the frequently used data on the fastest drive?

At this point when I install my 120gig ssd, I was planning on putting / , /home as well as my VirtualBox images on the ssd for increased speed.

Any thoughts?

MCP

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11577
  • ----IOFLU----
Re: Default Scheduler Deadline for SSD?
« Reply #6 on: February 20, 2012, 09:32:19 PM »

Just so that I'm clear on this as well.  Since most of the older info is out of date as you mention.  What tweaks are absolutely needed and what is to be avoided?  I've read that you shouldn't put your home or tmp directories on the ssd as this will wear it out.  But as Parnote pointed why wouldn't you want the frequently used data on the fastest drive?

At this point when I install my 120gig ssd, I was planning on putting / , /home as well as my VirtualBox images on the ssd for increased speed.

Any thoughts?

MCP

Treat it like a regular drive. Partition it like you want it, using the regular PCLinuxOS tools when installing. Parnote did that, and his system is working just fine.

I just ran parted on my Green drive, partitioned without anything but the defaults provided by Linux fdisk, to check all the partitions for correct alignment.

(parted) help                                                             
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment

Code: [Select]
(parted) align-check opt 1
1 aligned
(parted) align-check opt 2
2 aligned
(parted) align-check opt 3
3 aligned
(parted) align-check opt 4
4 aligned
(parted) align-check opt 5
5 aligned

No fuss, no muss.

« Last Edit: February 20, 2012, 09:42:30 PM by Old-Polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Nish

  • Sr. Member
  • ****
  • Posts: 384
    • SMQ's Adventures in Linux
Re: Default Scheduler Deadline for SSD?
« Reply #7 on: February 21, 2012, 03:51:42 AM »

Just so that I'm clear on this as well.  Since most of the older info is out of date as you mention.  What tweaks are absolutely needed and what is to be avoided?  I've read that you shouldn't put your home or tmp directories on the ssd as this will wear it out.  But as Parnote pointed why wouldn't you want the frequently used data on the fastest drive?

At this point when I install my 120gig ssd, I was planning on putting / , /home as well as my VirtualBox images on the ssd for increased speed.

Any thoughts?

MCP


Hi MCP & Kah, I had many of the same questions as you when I purchased a SSD.  I too had read you shouldn't put home or swap on the SSD.
http://www.pclinuxos.com/forum/index.php/topic,100417.0.html  The swap I could understand on windows where it is constantly being written to and accessed but with a 4GB swap partition and 2GB of RAM in linux I have never touched mine.  Not putting /home on the SSD made absolutely no sense either.  Except for one area of /home they mentioned, that is the browser cache.  That sees activity much like a swap in a windows system.  But I just can't get with the idea of using this for what just, storage?  Why in the world use a SSD for static storage you don't access much? I have a slow as dirt USB MyBook external for that.  With a lot more capacity than my SSD.

I am just finally getting around to building the system I bought my SSD for. I will look forward to your posting what you decide to do.
« Last Edit: February 21, 2012, 03:56:29 AM by Nish »
Never borrow time.  The interest will kill you - signed Mastercard & Visa

Embrace the Bird.  http://www.smqlinux.com - an old lady's adventures in linuxdom

Offline MCP

  • Sr. Member
  • ****
  • Posts: 371
Re: Default Scheduler Deadline for SSD?
« Reply #8 on: February 21, 2012, 03:22:48 PM »
I got the ssd installed.  Now a new problem.  The cd drive that previously worked just fine does not boot on restart.  It would previously not problem.  The drive works just fine after I boot into PCLOS.  It even booted in a VBox vm.  I tried disconnecting the ssd but still no go.  I keeps skipping past the cd drive and goes directly to boot from a harddrive even though my bios is set to boot first from cdrom.

Any Idea's what could cause this?  ???
MCP

Offline pags

  • Hero Member
  • *****
  • Posts: 2517
  • Keep it clean.
Re: Default Scheduler Deadline for SSD?
« Reply #9 on: February 22, 2012, 09:03:31 AM »
I got the ssd installed.  Now a new problem.  The cd drive that previously worked just fine does not boot on restart.  It would previously not problem.  The drive works just fine after I boot into PCLOS.  It even booted in a VBox vm.  I tried disconnecting the ssd but still no go.  I keeps skipping past the cd drive and goes directly to boot from a harddrive even though my bios is set to boot first from cdrom.

Any Idea's what could cause this?  ???
MCP

Jumper settings on the optical drive?  Master/Slave/Single vs. Cable Select?

Offline MCP

  • Sr. Member
  • ****
  • Posts: 371
Re: Default Scheduler Deadline for SSD?
« Reply #10 on: February 22, 2012, 10:23:38 AM »
I got the ssd installed.  Now a new problem.  The cd drive that previously worked just fine does not boot on restart.  It would previously not problem.  The drive works just fine after I boot into PCLOS.  It even booted in a VBox vm.  I tried disconnecting the ssd but still no go.  I keeps skipping past the cd drive and goes directly to boot from a harddrive even though my bios is set to boot first from cdrom.

Any Idea's what could cause this?  ???
MCP

Jumper settings on the optical drive?  Master/Slave/Single vs. Cable Select?

Sorry I didn't get back right away.  I found that when I switched to the AHCI controller it now lists my DVD Drive by name.  So I had to select that instead of cdrom to boot first.  Unfortunately it was lower on the menu and not readily apparent.  So that is fixed now.

I decided to just allow PCLOS to do everything automatically and take over the whole drive.  So now I have a brand new install of PCLOS 2012.  However since it has been such a long time since I installed PCLOS, and since it is constantly being upgraded I now have the problem of trying to remember how I got it setup in the first place.

Lesson learned-Never, Never, Never rely on just you memory.  :o

Now I'm stuck trying to get it all right. :(

MCP