PayPC System Mail Subscriber
1998-Sep-22 11:27 UTC
File copy speed differences... writing to SAMBA is faster than reading from it??!
Here's an interesting thing I notice between NTSP3 and Linux 2.0.33+ w/samba 1.9.18p8 [TCP_NODELAY, read prediction on, SND and RCV buffers to 64k, though I've tried 16k, 32K, 64k, max size 2k, 4k, 8k, 16k, no difference] When I copy a file from any share to my NT's HD, I get perhaps 280KB/sec. When I copy from NT HD to Samba share, I get almost 1MB/sec. Doesn't matter where the file lives, whether or not it's in cache (on the Linux box), or what. The network cards in both are 3Com's PCI 10/100BaseTX cards (3c905), both machines are AMD-K6-200 or better (the Linux box has the slower CPU, being 200Mhz, the NT box has a 250Mhz AMD-K6-233 overclocked at 83Mhz x 3 -- naturally of course, the Linux box seems to do everything faster despite the "handicap"). Anyhow... it's very strange. Even the old Macintoshes on my LAN outcopy NT (~700KB/sec thru netatalk). I've enclosed some packet sniffer logs, where you can see the vast differences in the way the data is being thrown around the wire. Note, it's strange because it's clear there's something kooky going on with the sequence # and ack# stuff, as well as the payload area itself. On the fast direction (NT->UNIX), the proto analyser gives clean NetBIOS area decodes. But on the SAMBA->NT one, it warns about an invalid type, and a "probably continuation of prior transaction" message. I suspect this is a clue as to why I observe this behaviour. Has anyone else seen this behaviour? I can't be the first person to have noticed this disparity in performance, however I see no mention of it in the FAQs or "bug lists". I must say, that otherwise, samba is nothing but tip-top perfect in its operation otherwise - I have no real complaints about its operation. View this message with a fixed-spaced font for better clarity. Relevant portions of smb.conf: socket options = TCP_NODELAY (I've also tried IPTOS_THROUGHPUT, no differences) read prediction = True (does this actually help?) time server = True preserve case = yes short preserve case = yes delete veto files = yes max xmit = 65535 (tried from 8k on up... doesn't make significant differences) read size = 8192 (tried from 2k to 16k, again, no differences) mangle case = no read raw = yes (these aren't actually obeyed anymore, are they?) write raw = yes dead time = 5 getwd cache = Yes Note: the large quantities of ACK traffic in the UNIX->NT log as compared to the NT->UNIX one. Also interesting is the Seq# changing in the UNIX->NT case while the Ack# is the same [for the "payload" packets that are 1518 bytes], while the opposite is true in the UNIX->NT case. The 122 byte packets coming from the copy-target are the SMB command blocks. (in case it doesn't make it, the µ is the mu symbol for micro). Thanks, Robert -------->From UNIX to NT (slow):Destination Size Time-Stamp Protocol Plug-In Details IP UNIX BOX 122 00s 014098µ IP TCP Seq#: 8062832 Ack#: 3354657519 IP NT4SP3 BOX 1518 00s 004303µ IP TCP Seq#: 3354657519 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001269µ IP TCP Seq#: 3354658979 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001220µ IP TCP Seq#: 3354660439 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001259µ IP TCP Seq#: 3354661899 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001481µ IP TCP Seq#: 3354663359 Ack#: 8062896 IP UNIX BOX 64 00s 000186µ IP TCP Seq#: 8062896 Ack#: 3354660439 IP UNIX BOX 64 00s 000133µ IP TCP Seq#: 8062896 Ack#: 3354663359 IP NT4SP3 BOX 1518 00s 000894µ IP TCP Seq#: 3354664819 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001217µ IP TCP Seq#: 3354666279 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001511µ IP TCP Seq#: 3354667739 Ack#: 8062896 IP UNIX BOX 64 00s 000199µ IP TCP Seq#: 8062896 Ack#: 3354664819 IP NT4SP3 BOX 1518 00s 000850µ IP TCP Seq#: 3354669199 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001255µ IP TCP Seq#: 3354670659 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001666µ IP TCP Seq#: 3354672119 Ack#: 8062896 IP UNIX BOX 64 00s 000186µ IP TCP Seq#: 8062896 Ack#: 3354664819 IP UNIX BOX 64 00s 000132µ IP TCP Seq#: 8062896 Ack#: 3354664819 IP UNIX BOX 64 00s 000131µ IP TCP Seq#: 8062896 Ack#: 3354664819 IP UNIX BOX 64 00s 000123µ IP TCP Seq#: 8062896 Ack#: 3354664819 IP NT4SP3 BOX 1518 00s 192684µ IP TCP Seq#: 3354664819 Ack#: 8062896 IP UNIX BOX 64 00s 000212µ IP TCP Seq#: 8062896 Ack#: 3354673579 IP NT4SP3 BOX 1518 00s 001046µ IP TCP Seq#: 3354673579 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001481µ IP TCP Seq#: 3354675039 Ack#: 8062896 IP UNIX BOX 64 00s 173042µ IP TCP Seq#: 8062896 Ack#: 3354675039 IP NT4SP3 BOX 1518 00s 001132µ IP TCP Seq#: 3354676499 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001486µ IP TCP Seq#: 3354677959 Ack#: 8062896 IP UNIX BOX 64 00s 000188µ IP TCP Seq#: 8062896 Ack#: 3354675039 IP UNIX BOX 64 00s 000131µ IP TCP Seq#: 8062896 Ack#: 3354675039 IP NT4SP3 BOX 1518 00s 191410µ IP TCP Seq#: 3354675039 Ack#: 8062896 IP UNIX BOX 64 00s 000733µ IP TCP Seq#: 8062896 Ack#: 3354679419 IP NT4SP3 BOX 1518 00s 000494µ IP TCP Seq#: 3354679419 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001251µ IP TCP Seq#: 3354680879 Ack#: 8062896 IP UNIX BOX 64 00s 000192µ IP TCP Seq#: 8062896 Ack#: 3354682339 IP NT4SP3 BOX 1518 00s 001179µ IP TCP Seq#: 3354682339 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001346µ IP TCP Seq#: 3354683799 Ack#: 8062896 IP UNIX BOX 64 00s 000187µ IP TCP Seq#: 8062896 Ack#: 3354685259 IP NT4SP3 BOX 1518 00s 001191µ IP TCP Seq#: 3354685259 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001356µ IP TCP Seq#: 3354686719 Ack#: 8062896 IP UNIX BOX 64 00s 000184µ IP TCP Seq#: 8062896 Ack#: 3354688179 IP NT4SP3 BOX 1518 00s 001191µ IP TCP Seq#: 3354688179 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001229µ IP TCP Seq#: 3354689639 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001372µ IP TCP Seq#: 3354691099 Ack#: 8062896 IP UNIX BOX 64 00s 000186µ IP TCP Seq#: 8062896 Ack#: 3354691099 IP NT4SP3 BOX 1518 00s 001078µ IP TCP Seq#: 3354692559 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001360µ IP TCP Seq#: 3354694019 Ack#: 8062896 IP UNIX BOX 64 00s 000189µ IP TCP Seq#: 8062896 Ack#: 3354694019 IP NT4SP3 BOX 1518 00s 001341µ IP TCP Seq#: 3354695479 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001098µ IP TCP Seq#: 3354696939 Ack#: 8062896 IP UNIX BOX 64 00s 000198µ IP TCP Seq#: 8062896 Ack#: 3354696939 IP NT4SP3 BOX 1518 00s 001049µ IP TCP Seq#: 3354698399 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001361µ IP TCP Seq#: 3354699859 Ack#: 8062896 IP UNIX BOX 64 00s 000194µ IP TCP Seq#: 8062896 Ack#: 3354699859 IP NT4SP3 BOX 1518 00s 001075µ IP TCP Seq#: 3354701319 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001365µ IP TCP Seq#: 3354702779 Ack#: 8062896 IP UNIX BOX 64 00s 000190µ IP TCP Seq#: 8062896 Ack#: 3354702779 IP NT4SP3 BOX 1518 00s 001001µ IP TCP Seq#: 3354704239 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001452µ IP TCP Seq#: 3354705699 Ack#: 8062896 IP UNIX BOX 64 00s 000193µ IP TCP Seq#: 8062896 Ack#: 3354705699 IP NT4SP3 BOX 1518 00s 001051µ IP TCP Seq#: 3354707159 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001220µ IP TCP Seq#: 3354708619 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001558µ IP TCP Seq#: 3354710079 Ack#: 8062896 IP UNIX BOX 64 00s 000188µ IP TCP Seq#: 8062896 Ack#: 3354708619 IP UNIX BOX 64 00s 000133µ IP TCP Seq#: 8062896 Ack#: 3354711539 IP NT4SP3 BOX 1518 00s 000867µ IP TCP Seq#: 3354711539 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001210µ IP TCP Seq#: 3354712999 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001792µ IP TCP Seq#: 3354714459 Ack#: 8062896 IP UNIX BOX 64 00s 000209µ IP TCP Seq#: 8062896 Ack#: 3354714459 IP NT4SP3 BOX 1518 00s 000851µ IP TCP Seq#: 3354715919 Ack#: 8062896 IP NT4SP3 BOX 1518 00s 001335µ IP TCP Seq#: 3354717379 Ack#: 8062896 IP UNIX BOX 64 00s 000183µ IP TCP Seq#: 8062896 Ack#: 3354717379 IP UNIX BOX 64 00s 170989µ IP TCP Seq#: 8062896 Ack#: 3354718839 IP NT4SP3 BOX 178 00s 000193µ IP TCP Seq#: 3354718839 Ack#: 8062896 Example payload packet: Flags: 0x00 Status: 0x00 Packet Length:1518 Timestamp: 19:53:44.912916 09/22/98 Ethernet Header Destination: 00:60:08:a0:d1:d0 [0-5] Source: 00:60:08:a0:d1:c1 [6-11] Protocol Type:0x0800 [12-13] IP IP Header - Internet Protocol Datagram Version: 4 [14 Mask 0xf0] Header Length: 5 [14 Mask 0x0f] Precedence: 0 [15 Mask 0xe0] Type of Service: %0000 [15 Mask 0x1e] Unused: %0 [15 Mask 0x01] Total Length: 1500 [16-17] Identifier: 2005 [18-19] Fragmentation Flags: %000 [20 Mask 0xe0] Fragment Offset: 0 [20-21 Mask 0x1fff] Time To Live: 64 [22] IP Type: 0x06 [23] TCP Header Checksum: 0x89e5 [24-25] Source IP Address: yy.yy.yy.yy [26-29] Dest. IP Address: xx.xx.xx.xx [30-33] No Internet Datagram Options TCP - Transport Control Protocol Source Port: 139 [34-35] NETBIOS Session Service Destination Port: 1039 [36-37] Sequence Number: 3355523554 [38-41] Ack Number: 8064496 [42-45] Offset: 5 [46 Mask 0xf0] Reserved: %000000 [46 Mask 0x00] Code: %010000 [47 Mask 0x3f] Ack is valid Window: 32736 [48-49] Checksum: 0x523d [50-51] Urgent Pointer: 0 [52-53] No TCP Options NetBIOS Session Service - Network Basic Input/Ouput System Invalid Packet Type: 10 (Probably a continuation of previous transaction) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^ All payload packets from samba->NT say this in the protocol analyser NetBIOS Data: ----->From NT to UNIX (fast)Destination Size Time-Stamp Proto Plug-In Details IP NT4SP3 BOX 64 00s 491536µ IP TCP Seq#: 1453961822 Ack#: 8984086 IP UNIX BOX 1518 00s 001148µ IP TCP Seq#: 8994306 Ack#: 1453961822 IP UNIX BOX 1518 00s 001686µ IP TCP Seq#: 8995766 Ack#: 1453961822 IP UNIX BOX 1518 00s 002074µ IP TCP Seq#: 8997226 Ack#: 1453961822 IP UNIX BOX 1518 00s 000226µ IP TCP Seq#: 8998686 Ack#: 1453961822 IP UNIX BOX 1518 00s 001247µ IP TCP Seq#: 9000146 Ack#: 1453961822 IP NT4SP3 BOX 64 00s 000194µ IP TCP Seq#: 1453961822 Ack#: 8995766 IP UNIX BOX 1518 00s 000941µ IP TCP Seq#: 9001606 Ack#: 1453961822 IP UNIX BOX 1518 00s 001278µ IP TCP Seq#: 9003066 Ack#: 1453961822 IP UNIX BOX 1518 00s 001212µ IP TCP Seq#: 9004526 Ack#: 1453961822 IP UNIX BOX 1518 00s 001229µ IP TCP Seq#: 9005986 Ack#: 1453961822 IP UNIX BOX 1518 00s 001412µ IP TCP Seq#: 9007446 Ack#: 1453961822 IP NT4SP3 BOX 64 00s 000209µ IP TCP Seq#: 1453961822 Ack#: 9005986 IP UNIX BOX 1518 00s 001067µ IP TCP Seq#: 9008906 Ack#: 1453961822 IP UNIX BOX 1518 00s 001394µ IP TCP Seq#: 9010366 Ack#: 1453961822 IP UNIX BOX 1518 00s 001080µ IP TCP Seq#: 9011826 Ack#: 1453961822 IP UNIX BOX 1518 00s 001258µ IP TCP Seq#: 9013286 Ack#: 1453961822 IP UNIX BOX 1518 00s 001247µ IP TCP Seq#: 9014746 Ack#: 1453961822 IP UNIX BOX 1518 00s 001465µ IP TCP Seq#: 9016206 Ack#: 1453961822 IP UNIX BOX 1518 00s 001148µ IP TCP Seq#: 9017666 Ack#: 1453961822 IP NT4SP3 BOX 64 00s 000199µ IP TCP Seq#: 1453961822 Ack#: 9017666 IP UNIX BOX 1518 00s 001044µ IP TCP Seq#: 9019126 Ack#: 1453961822 IP UNIX BOX 1518 00s 001225µ IP TCP Seq#: 9020586 Ack#: 1453961822 IP UNIX BOX 1518 00s 001226µ IP TCP Seq#: 9022046 Ack#: 1453961822 IP UNIX BOX 1518 00s 001306µ IP TCP Seq#: 9023506 Ack#: 1453961822 IP UNIX BOX 1518 00s 001207µ IP TCP Seq#: 9024966 Ack#: 1453961822 IP UNIX BOX 1518 00s 001196µ IP TCP Seq#: 9026426 Ack#: 1453961822 IP UNIX BOX 1518 00s 001249µ IP TCP Seq#: 9027886 Ack#: 1453961822 IP UNIX BOX 1518 00s 001229µ IP TCP Seq#: 9029346 Ack#: 1453961822 IP UNIX BOX 1518 00s 001259µ IP TCP Seq#: 9030806 Ack#: 1453961822 IP UNIX BOX 1518 00s 001419µ IP TCP Seq#: 9032266 Ack#: 1453961822 IP NT4SP3 BOX 64 00s 000195µ IP TCP Seq#: 1453961822 Ack#: 9029346 IP UNIX BOX 1518 00s 001056µ IP TCP Seq#: 9033726 Ack#: 1453961822 IP UNIX BOX 178 00s 000177µ IP TCP Seq#: 9035186 Ack#: 1453961822 IP NT4SP3 BOX 99 00s 004000µ IP TCP Seq#: 1453961822 Ack#: 9035306 IP UNIX BOX 162 00s 000186µ IP TCP Seq#: 9035306 Ack#: 1453961863 IP NT4SP3 BOX 99 00s 000410µ IP TCP Seq#: 1453961863 Ack#: 9035410 Example payload packet: Flags: 0x00 Status: 0x00 Packet Length:1518 Timestamp: 20:07:51.745372 09/22/98 Ethernet Header Destination: 00:60:08:a0:d1:c1 [0-5] Source: 00:60:08:a0:d1:d0 [6-11] Protocol Type:0x0800 [12-13] IP IP Header - Internet Protocol Datagram Version: 4 [14 Mask 0xf0] Header Length: 5 [14 Mask 0x0f] Precedence: 0 [15 Mask 0xe0] Type of Service: %0000 [15 Mask 0x1e] Unused: %0 [15 Mask 0x01] Total Length: 1500 [16-17] Identifier: 57211 [18-19] Fragmentation Flags: %010 [20 Mask 0xe0] Do Not Fragment Fragment Offset: 0 [20-21 Mask 0x1fff] Time To Live: 128 [22] IP Type: 0x06 [23] TCP Header Checksum: 0x323e [24-25] Source IP Address: xx.xx.xx.xx [26-29] Dest. IP Address: yy.yy.yy.yy [30-33] No Internet Datagram Options TCP - Transport Control Protocol Source Port: 1041 [34-35] Destination Port: 139 [36-37] NETBIOS Session Service Sequence Number: 9240482 [38-41] Ack Number: 1453962150 [42-45] Offset: 5 [46 Mask 0xf0] Reserved: %000000 [46 Mask 0x00] Code: %010000 [47 Mask 0x3f] Ack is valid Window: 8060 [48-49] Checksum: 0x9827 [50-51] Urgent Pointer: 0 [52-53] No TCP Options NetBIOS Session Service - Network Basic Input/Ouput System Packet Type: 0x00 [54] Session Message Flags: 0x00 [55] Length Extension Off Length: 0 User Data: note, no "continued transaction" message - EVER in any payload packet from NT->SAMBA.