Securing and Optimizing Linux: RedHat Edition -A Hands on Guide | ||
---|---|---|
Prev | Chapter 31. Software -Server/File Sharing-Network | Next |
It is a big mistake to set the wide links Samba parameter to no in the Samba configuration file /etc/smb.conf. This option, if set to no, tells Samba not to follow symbolic links outside of an area designated as being exported as a share point. In order to determine if a link points outside the shared area, Samba has to follow the link and then do a directory path lookup to determine where on the file system the link ended up. This ends up adding a total of six extra system calls per filename lookup, and Samba looks up filenames a lot. A test done was published that showed that setting this parameter will cause a 25 to 30 -percent slowdown in Samba performance.
The modification of the filesystem cache-tuning parameters can significantly improve Linux's file-serving performance up to a factor of two. Linux will attempt to use memory not being used for any other purpose for filesystem caching. A special daemon, called bdflush, will periodically flush dirty buffers, buffers that contain modified filesystem data or metadata to the disk.
The secret to good performance is to keep as much of the data in memory for as long as is possible. Writing to the disk is the slowest part of any filesystem. If you know that the filesystem will be heavily used, then you can tune this process for Linux Samba. As with many kernel tuneable options, this can be done on the fly by writing to special files in the /proc filesystem. The trick is, you have to tell Linux you want it to do that. You do so by executing the following command for a Linux 2.2 kernel.
The default setup for the bdflush parameters under Red Hat Linux is:
"40 500 64 256 500 3000 500 1884 2" |
Under
[root@deep ] /# echo "80 500 64 64 15 6000 6000 1884 2" >/proc/sys/vm/bdflush |
Under Edit the /etc/sysctl.conf file and add the following line:
# Improve file system performance vm.bdflush = 80 500 64 64 15 6000 6000 1884 2 |
You must restart your network for the change to take effect. The command to restart the network is the following:
[root@deep ] /# /etc/rc.d/init.d/network restart |
Setting network parameters [ OK ] Bringing up interface lo [ OK ] Bringing up interface eth0 [ OK ] Bringing up interface eth1 [ OK ] |