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.