Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've setup samba on a remote linux server. It has a share that points to a folder on an external HDD with ext4 filesystem (about 90% free space). The server can be accessed via na ethernet connection. The files inside the remote share are fully visible from a file browser on my computer. Copying files from and to the server from my local computer works fine, and goes about 8-9 MB/s. This is fine for a 100MBit ethernet.
However when I access the share, and try to copy a file from one folder to another within the *same* share, the speed is only about 3-4 MB/s. This happens when I copy on a linux xubuntu and on a windows 7 machine. I've benchmarked the disk transfer speed with dd on the server, and it should go about 60MB/s (it's on a sata port). Why the hell is this copy operation so slow when the source and destination are on the same drive within the same samba share? Surely samba can't be so stupid to transfer the file from the remote share to the local computer that's doing the copying procedure, and then again uploading the same file to another folder within the same share.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154
Rep:
What happens if you ssh into your remote machine and do the copy locally? if you get a reasonable speed that way then it looks like your assumption that it is copying files to the remote and back s true.
Just tried this from local
Code:
time cp /media/smb-192.168.1.66-lansite/Photos/Pictures/China/China1/dsc_0001.jpg /media/smb-192.168.1.66-lansite/tmp
real 0m2.689s
user 0m0.000s
sys 0m0.030s
From remote (ssh'd)
Code:
time cp /media/Media/Photos/Pictures/China/China1/dsc_0001.jpg /media/Media/tmp
real 0m0.124s
user 0m0.000s
sys 0m0.110s
As you can see there is a lot of difference (file size is about 6M)
Copying locally via ssh completes almost instantly. The back-n-forth sounds more and more like a plausible scenario. But how can I fix it? I mean obviously the back-n-forth approach is a waste of time and bandwidth, so considering the age of the samba project I'm guessing there has to be a way to correct this in samba.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154
Rep:
I don't think there is any way around that, either you do the copy locally and have to put up with copying back and forth or you use a remote copy and get a faster copy, apples and oranges!
NFS does the same. It takes about 35 seconds to copy a 200 MB file. Copying locally does it on just 4 seconds. The thing is I have to use windows file sharing. Is this a protocol limitation or something? Because I had expected a remote copy command would be built into the SMB just like the remote move command works (moving files in explorer completes instantly).
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154
Rep:
Had a good look around and there seems to be no way around this the only thing you can do is either put up with the upload/downloading delay or ssh into the remote machine and do a local copy
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.