Dell Mini 9 Hardware and Upgrades Discuss Dell Mini 9 Hardware and Upgrades.

Reply
 
LinkBack Thread Tools Display Modes
  (#1) Old
Guru
 
reflex's Avatar
 
Posts: 1,997
Join Date: Apr 2009
Cool Tips for tweaking SSD performance in Linux - 04-21-2009, 09:43 AM

Here's a list of system tweaks intended to improve Linux performance on a SSD. This thread addresses some Windows tweaks.


Enable file compression

Most Linux filesystems don't support compression, or support it only in an experimental/beta fashion. I don't think this isn't an viable option, yet.


Disable file access time updates to reduce writes.

When a file is accessed, many filesystems update the "last accessed time". This update generates additional I/O for all file reads, and has little benefit. So, it's probably a good idea to disable these updates.

To disable file access time updates, you'll need to edit the "/etc/fstab" file, which tells the system what filesystems to use and how to use them. Since screwing up "fstab" can seriously mess up your system, I recommend backing the file up, and having a bootable Linux USB drive waiting will make it easier to fix the worse screw-ups.

To edit "fstab", you'll need to launch a text editor with root privileges. One easy way to do that is to open a run dialog via Alt+F2, then execute "gksudo gedit /etc/fstab". Enter your password when prompted.

You'll see a text file with several lines, each with several whitespace separated fields. The first line describes the format of each line. The first line starts with a "#" to indicate that it's a comment.

Each non-comment line describes a filesystem. The default Dell Ubuntu install only uses a single partition. The line describing that single partition has a second field (mount point) of "/". The fourth field is a comma-separated list of mount options. Add "noatime" to the list of mount options.

danilovesky provided the default Dell fstab, which I no longer had readily available , so when you're done fstab should look like this:
Code:
/dev/sda2    /      ext3     defaults,noatime    0    0
proc         /proc  proc     defaults      0      0
(The amount of whitespace between fields doesn't matter.)

Reboot or run "sudo mount -o remount /" in a terminal to see the results of your change.


Move temporary files to a RAM disk to avoid unneccessary SSD I/O.

Create a RAM disk and set it to be mounted at "/tmp" by adding the following line to "/etc/fstab".
Code:
tmpfs     /tmp         tmpfs      mode=1777
When you reboot, a dynamically-sized RAM disk will be created with a maximum size of 1/2 your total RAM amount. It will be mounted at "/tmp".

Some programs, like Firefox, will still need a setting changed to use the RAM disk as temporary file storage. In Firefox, enter "about:config" in the address bar, and add the preference "browser.cache.disk.parent_directory" with the value "/tmp". Or disable Firefox's disk cache entirely, and only rely on its own memory cache.

Be aware that files under "/tmp" will be completely lost on reboot, power down, or power loss.


Change the I/O scheduler to one more suited for a SSD's quick seeks.

The I/O scheduler manages I/O requests. The default I/O scheduler in Linux is CFQ, the Completely Fair Scheduler. However, it's designed to maximize performance on conventional hard drives, not solid state drives.

Based on what I've read, the dumb "noop" scheduler or the "deadline" scheduler may offer improved performance on SSDs.

Add the following line to "/etc/rc.local" before "exit 0" to enable the "noop" scheduler on the internal SSD.
Code:
echo noop > /sys/block/sda/queue/scheduler
Add the following lines instead to use the "deadline" scheduler.
Code:
echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch
Adjusting the "fifo_batch" value for the "deadline" scheduler is another tweak which I've read about. A higher value should reduce seeks, but also increase latency. SSDs don't need to worry about excessive seeks, so we can set the value low.

I'm using the "deadline" scheduler myself. Because when I had the "noop" scheduler enabled on an SD card with my music, a large file copy was able to interrupt my music playback for several seconds.

Unfortunately, my technique sets the I/O scheduler late in the boot process. So, booting will still use the default CFQ scheduler. You can override the default by setting options in GRUB's config file, but overall I prefer my solution.


Align partitions to SSD blocks

Flash memory is managed in blocks, larger that the 512 byte units that partitions are measured in. I don't know the actual block size(s) of the SSDs in the Mini, but we can still try to reduce unneccessary I/O by aligning the partitions and the filesystems on them to larger blocks that 512 bytes.

Here's more information on aligning partitions and filesystems:
http://www.ocztechnologyforum.com/forum ... stcount=98

When I install Ubuntu 9.04 in a few days, I'm going to pessimistically assume that the SSD uses an erase block size of 512kB, and try to optimize for that by aligning the partition(s) to 512kB boundaries and using the tune2fs utility to set a RAID stripe-size of 512kB (from what I've read, this may help). If the erase block size is actually smaller than 512kB, I don't think my settings will have any ill effect other than couple wasted kB at the start and end of the drive.


I hope this info is helpful, and I hope other people can add their own contributions.


Mini 9 | Intel 5100 Wifi | Ubuntu 10.04 Netbook
Mini 1012 | SSD | Intel 6200 Wifi | Ubuntu 11.10 64bit
Reply With Quote
  (#2) Old
Member
 
weber72's Avatar
 
Posts: 37
Join Date: Apr 2009
Location: Colorado, USA
Send a message via AIM to weber72 Send a message via Skype™ to weber72
Default Re: Tips for tweaking SSD performance in Linux - 04-21-2009, 11:36 PM

Thanks for this. I'm still learning Linux, and the Mini 9 was the perfect opportunity for me to jump back in with both feet. I used to love to tweak my Windows systems, so I've been looking for something like this for a while.

Perhaps a sticky? (Either here, or in the Linux forums...)


Dell Mini 9 (Alpine White) -- 16GB SuperTalent SSD -- 2GB Kingston RAM -- 8GB Sandisk Ultra II SDHC -- 1.3MP webcam -- Windows 7 RC / Linux Mint 7 RC
Reply With Quote
  (#3) Old
Member
 
weber72's Avatar
 
Posts: 37
Join Date: Apr 2009
Location: Colorado, USA
Send a message via AIM to weber72 Send a message via Skype™ to weber72
Default Re: Tips for tweaking SSD performance in Linux - 04-21-2009, 11:40 PM

Also, here's my default fstab...I'm running Linux Mint 6, however, and not the Dell Ubuntu...

ext3 relatime,errors=remount-ro 0

Should I just add 'noatime' to that list, or replace 'relatime' with 'noatime'?


Dell Mini 9 (Alpine White) -- 16GB SuperTalent SSD -- 2GB Kingston RAM -- 8GB Sandisk Ultra II SDHC -- 1.3MP webcam -- Windows 7 RC / Linux Mint 7 RC
Reply With Quote
  (#4) Old
Guru
 
reflex's Avatar
 
Posts: 1,997
Join Date: Apr 2009
Default Re: Tips for tweaking SSD performance in Linux - 04-22-2009, 01:55 AM

Quote:
Originally Posted by weber72
Should I just add 'noatime' to that list, or replace 'relatime' with 'noatime'?
"atime", "noatime", and "relatime" are exclusive options. I think "relatime" is roughly between "atime" and "noatime" in terms of functionality and performance.

From what I've read, few programs use file access times. And I haven't noticed any problems on my systems with "noatime". So, I'm comfortable using "noatime", especially since it offers the best performance.


Mini 9 | Intel 5100 Wifi | Ubuntu 10.04 Netbook
Mini 1012 | SSD | Intel 6200 Wifi | Ubuntu 11.10 64bit
Reply With Quote
  (#5) Old
Guru
 
reflex's Avatar
 
Posts: 1,997
Join Date: Apr 2009
Default Re: Tips for tweaking SSD performance in Linux - 04-22-2009, 02:08 AM

I had a typo in the RAM disk section of my first post, so if anyone already edited their fstab to use a RAM disk, please check it against the now corrected version.


Mini 9 | Intel 5100 Wifi | Ubuntu 10.04 Netbook
Mini 1012 | SSD | Intel 6200 Wifi | Ubuntu 11.10 64bit
Reply With Quote
  (#6) Old
Junior Member
 
Posts: 17
Join Date: Dec 2008
Default Re: Tips for tweaking SSD performance in Linux - 04-22-2009, 05:48 PM

Thanks for the post. Trying these tweaks now.

For your reference, original Dell Ubuntu /etc/fstab looks like:

/dev/sda2 / ext3 defaults 0 0
proc /proc proc defaults 0 0
Reply With Quote
  (#7) Old
Guru
 
reflex's Avatar
 
Posts: 1,997
Join Date: Apr 2009
Default Re: Tips for tweaking SSD performance in Linux - 04-22-2009, 06:25 PM

Quote:
Originally Posted by danilovesky
Thanks for the post. Trying these tweaks now.

For your reference, original Dell Ubuntu /etc/fstab looks like:

/dev/sda2 / ext3 defaults 0 0
proc /proc proc defaults 0 0
And thank you for the default Dell fstab, I'll edit my post above to be in sync with it.


Mini 9 | Intel 5100 Wifi | Ubuntu 10.04 Netbook
Mini 1012 | SSD | Intel 6200 Wifi | Ubuntu 11.10 64bit
Reply With Quote
  (#8) Old
Junior Member
 
Posts: 4
Join Date: Oct 2013
Default 10-22-2013, 08:18 AM

Here are what I did
  • Install preload
  • Change swappiness to 0
  • Move logs files to RAM
There are some more from this page you can follow How to tweak and optimize SSD for Ubuntu, Linux Mint - Nam Huy Linux Blog
Reply With Quote
  (#9) Old
Junior Member
 
Posts: 9
Join Date: Dec 2009
Default 10-23-2013, 08:13 AM

Did you just reply to a thread from four years ago?
Reply With Quote
Reply

« SSD/WLAN Mini PCI-e Slot Differences | SSD Upgrade Question »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.mydellmini.com/forum/dell-mini-9-hardware-upgrades/6741-tips-tweaking-solid-state-drive-performance-linux.html
Posted By For Type Date
dunull.org Linux This thread Refback 06-17-2009 10:45 AM
dunull.org Blog Archive Optimizing SSD performance with linux This thread Pingback 06-01-2009 06:08 AM

Copyright © 2008-2011 MyDellMini.com.