|
webhosting |
Network Tuning General Network Tips :NB: You can find some configuration files in the directory of /proc and /proc/sys/net/ipv4
NFS:The rsize and wsize mount options (specifyable
in /etc/fstab) increase
the packet sizes used by NFS clients, and usually increase performance. Try mount -o rsize=8192,wsize=8192 -t nfs host:/dir /mnt/point SMB:A similar gain can be achieved with the
Samba server by setting the
following in smb.conf: socket options = SO_SNDBUF=4096 SO_RCVBUF=4096
Block sizesFor filesystems dedicated to serving fairly
large files, adopting a larger than default
1024 byte block size may yield significant performance gains. Recent transactions on the Linux list suggest that setting the block sizein an ext2 file system to 4096 instead of the default 1024 will result in less file fragmentation, faster fsck's, faster deletes and faster raw read speed, due to the reduced number of seeks. Unfortunately this cannot be changed on
the fly. Only a reformat will make this so. The
In addition to the information about when
files were created and last modified,filesystem
also records when a file was last accessed. This information is not particularly useful, and there is a cost associated with recording it. The ext2 filesystem allows the superuser to mark individual files such that their last access time is not recorded. This may lead to significant performance improvements when running find, and may also be useful on often accessed frequently changing files such as the contents of /var/spool/news. To set the attribute, use chattr +A filename For a whole directory tree, do something like: chattr -R +A /var/spool Additionally, entire partitions can be mounted with no access time updating, again, news spools are a prime example. The man page for mount lists the following option: noatime Do not update inode access times on this file system (e.g., for faster access on the news spool to speed up news servers). The syntax to do this automagically is to edit the /etc/fstab, adding in the noatime option to the options column, separated by a comma. e.g.: # device mount point type options dump frequency fsck pass number /dev/sdb1 /var/spool/news ext2 defaults,noatime 1 2
With the arrival of the mid 2.4.x kernels,
more filesystem choices are available in the
standard kernel (these have been previously available in the form of patches by the filesystem authors and various distributions as well). The ones that are meant as replacements to ext2fs are: ext3, resierfs, xfs (from SGI) and jfs (from IBM). All of these filesystems provide speed improvements especially on directories with large number of files in addition to their journaling capabilities. So if available in your preferred distribution, try out and test using these new available file systems to use as the underlying filesystem for NFS or Samba network file serving.
The disk subsystem of the Linux is very conservative with your data. When not completely sure if a certain disk or controller reliably handles a certain setting (such as using Ultra DMA or IDE Block Mode to transfer more sectors on a single interrupt or 32-bit bus transfers), it will default to the setting least likely to cause data corruption. Using a tool called hdparm, you can change the settings and evaluate their robustness before using them in a production environment. (Actually, hdparm primarily affects IDE systems. It affects only a very limited number of items on SCSI disks.) On our test computer, by enabling Ultra DMA (using the command hdparm -d1 /dev/hda), we sped up data-read transfers from 2.17 MB per second to 11.19 MB per second. Write transfers will see a similar increase in speed. On a significantly older machine, there was no change in speed.The only drawback to enabling this setting is the remote possibility that very old hardware will not properly implement Ultra DMA. The use of IDE Block Mode (also known as Multiple Sector Mode) via the command hdparm -m16 /dev/hdX Where(X = a ,c ,d .. so on) enabling 32-bit bus transfers with hdparm -c1 /dev/hdX and enabling the DMA with hdparm -d1 /dev/hdX can resulted a notable increase in speed .Combinedly we can also use the command hdparm -c1 -d1 -k1 /dev/hdX See the documentation for hdparm (man hdparm) for more information. ---------------------------------------------------------------------------------
New Journaling File System
The ext3 file system acts a bit differently
than the ext2 file system, and the
differences can appear in various ways. Advanced users may choose to tune the file system and I/O system for performance. This is an introduction to some of the more common tuning that advanced users may wish to try. All tuning, of course, needs to be done in the context of performance testing of specific applications; there is no "one size fits all" approach to tuning. This is, however, intended to provide some generally useful information. For example, you might run: /sbin/elvtune
-r 1024 -w 2048 /dev/sdd to change the Once you have found elvtune settings that
give you your most satisfactory mix of latency
There are some characteristic loads that show very significant speed improvement with the data=writeback option, which provides lower data consistency guarantees. In those cases, the data consistency guarantees are essentially the same as the ext2 file system; the difference is that the file system integrity is maintained continuously during normal operation (this is the journaling mode used by most other journaling file systems). One of these cases involves heavy syncronous writes. Other cases involve creating and deleting large numbers of small files heavily, such as delivering a very large flow of small email messages. If you switch from ext2 to ext3 and find that your application performance drops substantially, the data=writeback option is likely to give you a significant amount of performance back; you will still have some of the availability benefits of ext3 (file system is always consistent) even if you do not have the more expensive data consistency guarantees. Red Hat is continuing to work on several
performance enhancements to ext3, so you can
In most cases, users write data by extending
off the end of a file. Only in a few cases
(such as databases) do users ever write into the middle of an existing file. Even overwriting an existing file is done by first truncating the file and then extending it again. If the system crashes during such an extend
in data=ordered mode, then the data blocks
This might be relevant to Client Tuning. I have been trying various methods of getting win95 to talk to Samba quicker. The results I have come up with are: 1. Install the W2setup.exe file from www.microsoft.com. This is an update for the winsock stack and utilities which improve performance. 2. Configure the win95 TCPIP registry settings to give better perfomance. I use a program called MTUSPEED.exe which I got off the net. There are various other utilities of this type freely available. The setting which give the best performance for me are: (i) MaxMTU Remove (ii) RWIN Remove (iii) MTUAutoDiscover Disable (iv) MTUBlackHoleDetect Disable (v) Time To Live Enabled (vi) Time To Live - HOPS 32 (vii) NDI Cache Size 0 3. I tried virtually all of the items mentioned in the document and the only one which made a difference to me was the socket options. It turned out I was better off without any!!!!! In terms of overall speed of transfer, between various win95 clients and a DX2-66 20MB server with a crappy NE2000 compatible and old IDE drive (Kernel 2.0.30). The transfer rate was reasonable for 10 baseT. The figures are: Put Get P166 client 3Com card: 420-440kB/s 500-520kB/s P100 client 3Com card: 390-410kB/s 490-510kB/s DX4-75 client NE2000: 370-380kB/s 330-350kB/s I based these test on transfer two files a 4MB text file and a 16MB textfile. The results arn't bad considering the hardware Samba is running on. The updates mentioned in 1 and 2 brought up the transfer rates from just over 100kB/s in some clients. A new client is a P333 connected via a 100MB/s card and hub. The transfer rates from this were good: 450-500kB/s on put and 600+kB/s on get. Looking at standard FTP throughput, Samba is a bit slower (100kB/s upwards). I suppose there is more going on in the samba protocol, but if it could get up to the rate of FTP the perfomance would be quite staggering. _______________________________________________ I have tried to mention some resources on tuning a GNU/Linux OS to reach the highest levels of performance. The tuning tips provided here are merely the collection of all information gathered from the Net and some of my experiences which I have got during my brush with the GNU/Linux world. It is recommended to backup all your data before tuning your GNU/Linux box, because tuning may induce some changes which may not be compatible with you current setup. More on http://linuxperf.nl.linux.org/ |