Linux : SSD performance tweaking queue

linuxperformance-tuningssd

I've allready applied well known mountpoint options for ssd, enabled stuff in LVM for ssd optimisation as well.

Now i've ran into a possible challenge. Would it be possible to gather information on how to tune the values for the deadline io-scheduler such as shown below. To work better with this particular disk + controller.

/sys/block/sda/queue/
add_random              discard_zeroes_data     iostats                 max_integrity_segments  max_segment_size        nr_requests             read_ahead_kb           scheduler discard_granularity     hw_sector_size          logical_block_size      max_sectors_kb          minimum_io_size         optimal_io_size         rotational discard_max_bytes       
iosched/                max_hw_sectors_kb       max_segments            nomerges                physical_block_size    rq_affinity

For this Kingston V300 240G ssd the below seems to work well. Repeated iozone -0 showed much better values.

echo 64 > /sys/block/sda/queue/nr_requests
echo 640 > /sys/block/sda/queue/max_sectors_kb

I hope such tweaking might avoid some drawbacks of the Kingston SSD. It can really be a bottleneck on this system since it runs SATA2 instead of SATA3 as this SSD can handle.

Greetings,

SC

Best Answer

echo 640 > /sys/block/sda/queue/max_sectors_kb

That seems a particularly odd value for max_sectors_kb. You've not said which SSD this is - but most modern drives I've come across are using 4128 byte sectors (although many lie about their geometry - presumably to keep other operating systems happy). Certainly your OS is likely using 4kb pages, although the overriding figure should be the size of the physical sectors on the disk.

I would strongly caution that you optimize your config based on your application performance - not on benchmarking software. Admittedly it's not always practical to run high volumes of tests with realistic application data, but if you have a look at Jens Axboe's fio, it allows for extensive configuring such that it creates a more representative demand on your system.

Would it be possible to gather information on how to tune the values for the deadline io-scheduler such as shown below

If there were a single recipe which made everyone's computer go faster I think you'd have little trouble in finding it. Once you've dealt with the glaring issues then the answer is to measure throughput and tweak parameters under load, observing te response and avoiding local minima - if you are Google, then it's very worthwhile to destroy a few SSDs finding the optimal settings. If you only have one SSD, then this might not be the best idea?

(IMHO the best thing you could for the performance of this device, assuming your partitions are aligned, correctly is to NOT use LVM)