Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Linux Software

SMBclient and Local Access Transfers... 8

maan asks: "I recently started using smbclient under Linux. I know that many test results have showed that Samba as a server gives more throughput than an NT server. However, I have found that smbclient is much slower with than Windows when accessing the localhost. Anyone knows if the Samba client needs more work?" That's rather odd. Can someone verify this behavior? Does anyone have any possible explanations?
This discussion has been archived. No new comments can be posted.

SMBclient and Local Access Transfers...

Comments Filter:
  • Welp, on a Linux 2.2.6 box, with a NE2000 PCI network card, on a Pentium 133, I ran some tests.

    I wrote a program that counts the number of bytes read in from stdin, and then writes them to stdout. It also records the start/end time of its run, and starts timing from the recieving of the 1st byte.

    Then, I setup 2 netcat sessions, one listening on a port, and putting the output in /dev/null, and the other reading from /dev/zero, and piping it through my program, and then through to netcat, which sent it to the other netcat.

    I did this on both connections to 127.0.0.1 and my network cards IP, and the results are almost identical.

    225583104.000000 bytes
    6612615.740435 Bytes/sec
    52900925.923483 bits/sec

    I suspect that my CPU is probably limiting things though :)

    Later I'll try it on a K6II/400 and see if the results are any different.

    Btw - I realize that my test isn't exactly accurate, but the figures are probably in the right area. If you see an obvious mistake in my measuring, let me know.

    Oh, if you want the program to laugh at my coding, email me :)

  • Lets not forget, when you do stuff via SMB, it needs to first be packaged up in smb packets, then sent through to the network device, which then puts a TCP/UDP header on it, and then an IP header on it. I'm not quite sure where it figures out that its destined for the local machine, but it will be ethier here or at the next level down (putting a ethernet header on it).

    Why do ALL this stuff instead of just taking the shortcut? Because the loopback device (127.x.x.x) is suppose to simulate a network. loopback will be faster only in that it doesn't have to put it on the wire for xx milliseconds. I'm not saying there are any inbuilt delays, rather loopback wasn't designed with speed in mind.

    For highspeed communication to processes on your local machine, you probably shouldn't use network sockets. I'm not sure, but Unix sockets may be faster, otherwise pipes.

    Nick

  • For some reason my question didn't come out right. Either cliff edited it or I sent it in wrong. My problem is that smbclient to another machine is really slow in copying file to my machine. On the same box, a copy from the server but in windows this time is much faster. Any ideas?
  • The loopback device is indeed supposed to simulate a network, however in a machine with a network device already working, using that IP address is faster.

    The ip to my computer is 1.2.3.4. I can get almost a gigabit per second of bandwidth by ftping to 1.2.3.4 and downloading a file. FTPing to 127.0.0.1, however, results in about 10 kilobits per second. Try it yourself; I'd like to see if other people are experiencing this, or it's the odd 'just me' bug.

    Adding an IP and TCP header to a packet is fast and trivial; after this the kernel picks up the packet and delivers it directly to the receiving socket. Since this is slower over localhost, I would assume perhaps there is some throttling done to traffic over localhost.

  • I'm sure you could find a more specific place to ask any question rather than /.
    Sure, suggesting another place for help is great, don't get me wrong. But saying to take it somewhere else seems to me to be against the very nature of /.
    OTOH, a question like this probably would be answered more quickly with a judicious search on deja.com [deja.com].
  • This question should probably be asked on a samba mailing list, or even better, search the archieves first.

    http://us1.samba.org/samba/archives.html [samba.org].

  • I've had the observation that localhost is extremely slow on my linux box -- for some reason I get a throughput of about 10kbit/second over localhost. This seems to happen on freebsd boxen too.

    The solution to this problem is to use the actual IP address of your computer instead. I haven't tried 0.0.0.0, but that might work as well.

This file will self-destruct in five minutes.

Working...