network performance

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

network performance

Post by ^rooker »

This thread will contain tips, tricks and infos regarding network performance testing & tuning.

My first entry is a nice trick I figured out today:
In order to test raw network speed without disk or USB limitations in the measurement, just create a symbolic link to /dev/zero and then copy this virtual file to a destination.

In my setup, samba was sharing "/home/myuser/shared". Here's what I did:

Code: Select all

cd ~/shared
ln -s /dev/zero zero-file
open the samba share from another computer and copy the file "zero-file".
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Re: network performance

Post by ^rooker »

While I'm at it, I'll post an interesting article about "iperf" for testing the performance of your network infrastructure on a lower level:
"IPERF: How to test network Speed,Performance,Bandwidth"

And additionally: "Windows 7, Vista, 2008 Tweaks"
Tweaking Windows 7 / Vista TCP/IP settings for broadband internet connections
2008-04-24 10:40 by Philip
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

SMB/CIFS tuning

Post by ^rooker »

There are many articles about "Samba tuning", but almost all of them refer to running Samba as a server. In my setup, the "server" is a Windows7 machine (no server flavor, just "professional") and the Linux machine is solely the client.
Here's a list of what I found so far:

1) mount.cifs manpage:
http://linux.die.net/man/8/mount.cifs
This is a great resource where you can see all the parameters you can supply if mounting a CIFS source.

2) CIFSMaxBufSize:
This controls the maximum buffer size that can be set with rsize/wsize.
According to bug-report #1236607 on launchpad, setting this to higher values, like "CIFSMaxBufSize=65536" or even "CIFSMaxBufSize=130048" could give a performance boost.

3) Linux TCP tuning:
http://www.overclockers.com/forums/show ... ost6925170:
# Increase TCP max buffer size setable using setsockopt ()
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
# Increase Linux autotuning TCP buffer limits
# Min, default, and max number of bytes to use
# Set max to at least 4MB, or higher if you use very high BDP paths
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216

Links:
To be continued...
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

High load, although nothing's running.

Post by ^rooker »

I just realized, that on the one server which caused me to investigate in my network performance, I've now stopped everything that's running, but still have a very high load of around 0.70 :shock:
Then I found this thread:
http://serverfault.com/questions/259613 ... ge-low-cpu
You are probably having processes on UNINTERRUPTIBLE_SLEEP state, normally they are on that state because they are waiting on something from hardware like reading from a disk. Those processes are effectively sleeping (you have 244 sleeping processes) but they enter the Load Average calculation. Check your server IO with vmstat and see if you have many D statuses on top or ps to confirm.

EDIT: Seeing your vmstat output further confirms the IO problem. Your b column under procs show an average of 100 processes on uninterruptible sleep. Your bi column (blocks read from a block device) is very high, as well as the si column (memory read from swap/disk). Finally, under the cpu header, the wa column shows that your CPU spends more than 90% waiting for IO to complete.

You must check why you are having those problems with IO. It can be lack of server's capacity, processes running wild and some other reasons, but it's definitively IO.
And "top" actually shows 153 sleeping processes, which are possibly waiting for I/O to happen - which doesn't.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply