3

I have a Samba server configured in my PC.

When other PCs in LAN download data from the server, top command shows smbd occupies 75% CPU. While they transfer data to the server, top command shows smbd occupies 30% CPU.

I guess this is because for data receiving, the server does not need to compute the header or the checksum.

Are there any more precise explanation to this?


Another question is why smbd does not occupy more CPU?

Because, the connection in my LAN is 1Gbit and the rate for both directions only reach 90Mbit/s. So why not smbd takes more CPU to reach higher rate. During the receiving, profiling results show that the CPU even have about 30% time with nothing to do at all (default_idle()).


@Mircea Vutcovici The test file is a 690MB .avi. Samba version is 3.0.24. The file system is FAT and the file is stored in a USB2.0 external hard disk(>200Mbit/s). There is no offload engine. CPU spend most its time in kernel space, for example, smbd consumes 75% where about 40% is consumed by Linux network stack. Sendfile is activated but without SG support, so actually it is tcp_sendmsg used instead of tcp_sendpage.

sliter
  • 225
  • 1
  • 3
  • 6
  • Vote to close - no a professional sys admin question, more superuser. – TomTom Dec 16 '11 at 14:36
  • Are you making the tests with large files or with plenty of small ones? Which distribution and version are you running? What file system are you using where the shared folders reside? Did you configured the NIC for TCP offloading (TOE)? Is the CPU time spend in kernel space or user space? Do you have errors on the NICs - check all networking equipment on the path? Do you use Ethernet Jumbo frames? – Mircea Vutcovici Dec 16 '11 at 14:45

2 Answers2

1

the server does not need to compute the header or the checksum.

Actually it has to. How else can it check the checksum is correct?

Because, the connection in my LAN is 1Gbit and the rate for both directions only reach 90Mbit/s

MBit or Megabyte. If you see a megabyte speed - as you do for example in wnidows explorer - that IS pretty much full.

TomTom
  • 51,649
  • 7
  • 54
  • 136
1

this is a known problem with samba,CPU usage can be quite high, particularly,when samba has to look for files of large folders that aren't in its cache. This is also caused by several network shares and processes running that will consume the CPU's time and resources.

s1los
  • 48
  • 3