My LAN structure:

  • A PC acts as a Samba client, IP:
  • A NAS router which runs a Samba server, IP: The NAS router uses a USB key as its storage device and the USB has a 15MB/s max speed.

Client download a 310MB file which takes 42.1s, that is 7,36MB/s. Result of profiling(the NAS router's linux stack has oprofile built) during the transmission shows that there is about 37% of CPU time that the CPU is in default_idle function. I want to understand why there is such a high portion of default_idle.

Here is how I did:

  1. I copied a file from the USB to the router's ramfs. The downloading rate reaches 15MB/s.

  2. I build iperf in the NAS router and in the PC to test the max transmit rate of the network. The iperf results shows the max speed is about 11.4MB/s in both direction.

Well, now it seems that the limit of 7.36MB/s is caused by the samba suite. To find the place where cause this limit perhaps can help to explain the high portion of default_idle function.

But I don't know how to continue. Please gives some advice and suggestion.



SMB has considerable protocol overhead; this is unfortunately not something you can "fix".

Seeing as you apparently run on 100mbit, the iperf "theoretical" practical limt of 11.4MB/sec will never be reached by any payload; I say theoretical because iperf assumes perfect conditions and does not take any windowing faults, errors or retransmissions into account; it measures pure low-level IP packet throughput.

If you can set up an ftpd on the router and test that, you will find that you can come much closer to that 11.4MB bandwidth limit (FTP is known to have the least overhead of any file transfer protocol.) Alternatively, see what you can achieve by just using netcat to pump data to or from a file.

  • Hi @adaptr, thanks for your answer. As you said SMB has considerable protocol overhead. But I am still not clear if this can explain the 37% of default_idle function. I think if the portion goes down to around 10%, the CPU can have more clocks available to handle smbd process which in turn increase its performance. – sliter Oct 25 '11 at 15:33
  • Hi, I found the problems. In fact, it is the ehternet card in the PC which runs on 100mbit that put the limits. The arm in NAS router quick enough, so it has to wait in order not overflowing the ehternet card buffer. That's explain why there are so many default_idle. Thanks – sliter Oct 26 '11 at 9:50

anecdotal but a friend of mine was working with wireless HD video delivery and found a major increase in throughput switching to NFS from Samba..he said 2-3 times faster. I beleive this goes along with what adaptr was stating

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.