Freitag, 19. März 2010

Tuning Linux kernel for high volume media serverChange to ‘deadline’ I/O scheduler * From command line (change the device ‘sda’ to appropriate device

Change to ‘deadline’ I/O scheduler

*
From command line (change the device ‘sda’ to appropriate device):

1
echo “deadline” > /sys/block/sda/queue/scheduler

*
kernel parameter, change /boot/grub/menu.lst, add kernel parameter

1
elevator=deadline

Change VM parameters

There are two variables which control the behaviour of VM flushing and allocation and affect network and disk performance

1
2
3
4
    *
vm.dirty_background_ratio
*
vm.dirty_ratio

To set these values from command line

1
2
echo 20 > /proc/sys/vm/dirty_background_ratio
echo 60 > /proc/sys/vm/dirty_ratio

to make it permanent, edit /etc/sysctl.conf:

1
2
vm.dirty_background_ratio = 20
vm.dirty_ratio = 60

Increase readahead

To get current readahead value:

1
2
blockdev --getra /dev/sda
256

To increase it to a higher value like 16K:

1
blockdev --setra 16384 /dev/sda

Disable updating access time stamp for file system

Edit /etc/fstab, remove “atime” attribute if there is, add “noatime” attribute.