If you look for information on SSD and Linux, you’ll find many old and contradictory statements. Do you have to align partitions? Which filesystem is suitable for a solid state drive? Does journaling tear down such an expensive drive? Should one use offline discard or is it safe to issue a TRIM command after each delete operation? What I/O scheduler should be used?
Finally, I’ve found a statement from Intel dealing with SSD optimisation: http://cache-www.intel.com/cd/00/00/49/23/492352_492352.pdf
On partition alignment:
With the Intel SSD 320 Series, aligning partitions or RAID volumes is not required and provides no performance benefit.
(In the end I noticed that fdisk automatically imposes an offset of 2048 when creating new partitions in order to align them properly on all drives.)
On I/O schedulers:
With SSDs, it is recommended to use the simplest noop (no operation) scheduler, unless there are processes in the system that can produce excessive amounts of I/Os and starve other processes.
On capacity issues:
Setting usable capacity to 80% of the factory default configuration provides a balanced solution for many applications. Using more than 90% of the factory default capacity is not recommended, unless write component of the target workload is predominantly sequential.
On using TRIM:
The ATA Trim command allows proactively marking NAND blocks that contain user data – but which are no longer used – as invalid. This allows the SSD to be more efficient by eliminating the need for moving obsolete data during internal defragmentation activity. This approach improves write performance after large amounts of data are discarded.
However, if old data is discarded at the same rate as new data is written, simply overwriting the old data with new data is more efficient than using Trim.
Of course, the document focuses on server user cases.
In the end I came to the following conclusions for my use case “notebook”:
- use Ext4 filesystem and NoOp scheduler; traditionally I would have used ext3, but ext4 supports the TRIM command
- try online TRIM, i.e. mount filesystems with the discard option; until now the drive wasn’t bricked by it
- don’t impose hard limit on the usable capacity; I decided to favour “space is precious” over “space boost performance”