Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1267  / 3 Years ago, sun, june 27, 2021, 9:36:30

I got a Cat5e crossover cable to exchange files between my PC and Notebook real quick but the transfer rate is 1.3 MBs. Using USB 2.0 I'm soo much faster putting files on my external HDD. This can't be right, can it? Both PCs run 12.04 64bit.


More From » networking

 Answers
5

Reading your question I first thought : why samba ? it's a very inefficient way for transferring files.



Bit of explations :



the CIFS protocol "eats" a lot of your bandwidth. It's worst case senario is a lot of small files. If it's the case then it's a normal speed. (small is something under 10MB)



if it's the case here is why :



It all depends on your transport layer. You compared Ethernet+CIFS protocol to USB2+NTFS(OR FAT32) protocol.



First of all we have two distinct kind of way of managing your files here.
The first one (CIFS) is at file level and the second one (NTFS) is a block level.



At a performance point of view it means that CIFS has less performance because it has to use some block level manager to work correctly (if your Ubuntu is installed with defaults, it goes via EXT4).



Conclusion : At system level, CIFS has to go through via more layers than a USB2 Hard Drive (and that is why, with the same available bandwidth, you'll never have the same speed)



Then, about the "lot of small files effect" :
As I've said at the beginning, CIFS is poorly designed.
For each file or folder, CIFS has to do more than 10 communications (it varies depending on circumpstances) between the two PCs.
Let's imagine that you have 5000 files of 1KB each and the latency between the two PC is of 1ms.
That means that your transfer rate will last : 5000 files * 1ms * 10 = 50000 ms or 50 seconds witch means that your speed is : 5000 KB / 50seconds = 500KB/sec



Now in real case the latency is less than 1ms and you uses files over 1KB. A more realistic way would be (for files of 1MB) :



5000 files * 0.1ms * (10 + (2*1048576/1500)) = 704051 ms or 705 seconds so 7MB/sec



1500 is the default maximal data that you can send (the MTU). So your files are cutted by multiples of 1500.



Of course those are theory and are to be considered as ideal and does not take in consideration the available bandwidth (1Gbps, 100Mbps, etc)



In your specific case :



you have extremely slow result. I hope you can explain it via the explanations given at the beginning.



If not you need to check for some troubles at the network layer of one of your ubuntu.



First of all check the ifconfig result for both (open a terminal and type ifconfig). Here is mine :



eth0      Link encap:Ethernet  HWaddr 00:15:c5:5f:9e:be
inet addr:192.168.0.14 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4392375 errors:0 dropped:0 overruns:0 frame:0
TX packets:3493073 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4910280244 (4.9 GB) TX bytes:757387998 (757.3 MB)
Interrupt:16

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:629 errors:0 dropped:0 overruns:0 frame:0
TX packets:629 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:39732 (39.7 KB) TX bytes:39732 (39.7 KB)


My default interface is eth0. You have to take care of "errors,dropped,overrun and collisions" that stay at 0.



If not the case and you haven't touched the MTU of the interface (1500 is the default) then you can have




  • a trouble with either the cable or one or both machine's interface.
    (mostly if error or dropped is different of 0)

  • a trouble with your interface configuration in both machines



For the first one try to change your cable
For the second one, considering that it's eth0 and no more than eth0 is connected, type this :




  • Machine A : sudo ifconfig eth0 172.16.10.1

  • Machine B : sudo ifconfig eth0 172.16.10.2



then access your shares by using the IP of each machine instead of names (eg 172.16.10.2 when you are on machine A)



You can also put steroids on your samba (tweaking your smb.conf or enabling jumbo frames). But I advise you not to do so because it will hide and not fix your performance trouble. (you may go faster but still going slower than you must)



There can be a lot of other things. Those are the regular. please update me in need of more information.


[#31965] Monday, June 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
odenanno

Total Points: 207
Total Questions: 113
Total Answers: 94

Location: South Korea
Member since Sat, Oct 2, 2021
3 Years ago
odenanno questions
;