| Linode Forum https://forum.linode.com/ |
|
| Slow SCP through network https://forum.linode.com/viewtopic.php?f=19&t=8145 |
Page 1 of 1 |
| Author: | stw [ Sat Dec 03, 2011 9:02 pm ] |
| Post subject: | Slow SCP through network |
I don't want to bug Linode's staff too much with support tickets, so I hope someone can help me out here. The main issue is that I have large performance changes with "scp". One time it would take 8 seconds, another time 4 minutes. I am using "scp" to copy data back and furth between a node in Germany, and Linode. Here's an example. These two commands were executed within a minute of each other: Code: /srv# time scp -p -r -P 1234 -i /root/a.pem file1 node.in.europe:/tmp/test On the latter one, SCP would go from 0% to 100% within seconds, and then hang at 100% for minutes. Running SCP with -vvv gives me: Code: file1 100% 2184KB 728.1KB/s 00:03 for an instance where it takes long, and Code: file1 100% 2184KB 2.1MB/s 00:01 for an instance where it went fast. From that, I conclude that SCP can get the data ready very quickly, and spends most of its time waiting to be able to push the data out of the network interface. With that, I ran a couple of traceroutes, and I'm getting different routes every time: Code: /srv# traceroute node.in.europe I can repeat the traceroute, and it'll be different hosts everytime, however the dropouts are usually close to the Germany node, in the telia.net network. Now, using a traceroute from the Germany node to Linode uses an entire different route, avoiding telia.net altogether: Code: # traceroute node.in.the.us I guess my question basically is - what can I do? Is routing into the telia.net network something any of these providers can influence? Or am I barking up the wrong tree altogether and this isn't the real reason I'm getting these differences in performance? |
|
| Author: | hawk7000 [ Sat Dec 03, 2011 9:26 pm ] |
| Post subject: | Re: Slow SCP through network |
stw wrote: With that, I ran a couple of traceroutes, and I'm getting different routes every time:
Code: /srv# traceroute node.in.europe I can repeat the traceroute, and it'll be different hosts everytime, however the dropouts are usually close to the Germany node, in the telia.net network. Looks like the varying routes start already in the networklayer.com network, as the traffic sometimes seem to go out through telia.net and sometimes through gblx.net? (Based on the varying hosts at the same hopcount in the trace above.) Speculation follows: Seems like it's networklayer.com that for whatever reason switch back and forth between these two... Which quite possibly is because the route to whichever one they prefer is flapping or something to that regard. It's unclear if your problem related to which path is used, ie if one is actually notably better than the other, or if the problem is the actual switching back and forth. |
|
| Author: | vonskippy [ Sat Dec 03, 2011 10:01 pm ] |
| Post subject: | Re: Slow SCP through network |
stw wrote: I don't want to bug Linode's staff too much with support tickets
And yet Linode's Accounting Dept bugs me every month wanting payment. You pay for service - don't be afraid to use it. Worse that can happen is they say it's not a hardware/infrastructure problem so you're on your own. |
|
| Author: | hoopycat [ Sun Dec 04, 2011 12:17 am ] |
| Post subject: | |
I would lean towards a network thing, as well. scp's progress indicator is based on when the network stack accepts the data, not necessarily when it is actually delivered. (Try scping a file from home to somewhere else... it sits on 100% like its a Windows OS installation.) This smells a lot like inconvenient packet loss. Try laying down a ping while doing the scp, or maybe even mtr. Whatever is causing the routing to change is probably also dropping packets for a few seconds. |
|
| Author: | stw [ Sun Dec 04, 2011 1:46 pm ] |
| Post subject: | Re: Slow SCP through network |
First of all, thanks everyone for your insights. hawk7000 wrote: Looks like the varying routes start already in the networklayer.com network, as the traffic sometimes seem to go out through telia.net and sometimes through gblx.net? (Based on the varying hosts at the same hopcount in the trace above.) That's true - I noticed some of the replies came from different hosts, but I didn't see a pattern in there. I agree with you, networklayer.com is probably switching routes between telia.net and gblx.net - which makes it hard to tell what network (telia.net or gblx.net) makes SCP take this long - or whether it's the switching altogether that causes it. It still puzzles me that sometimes SCP finishes within seconds, and sometimes only after minutes have passed - yet the routes change within a traceroute. I'd assume that at some point, the speed of SCP would pick up if the route changes, or at least that it remains consistently low if route flapping itself is the issue - but instead the speed is either consistently slow, or consistently fast during a transfer. hoopycat wrote: This smells a lot like inconvenient packet loss.
Try laying down a ping while doing the scp, or maybe even mtr. Whatever is causing the routing to change is probably also dropping packets for a few seconds. That's a good idea - it's funny how I use traceroute and all, and then forget using one of the most basic tools. I guess I neglected that because I assumed that commercial connections would not possibly have packet loss, and that it'd be a problem constrained to poor ADSL lines. Anyway, you were correct; I ran a ping during the scp, and it would have a packet loss of around 20%. For a 25 second SCP, I got Code: --- node.in.europe ping statistics --- and for a 2 minute SCP I got Code: --- node.in.europe ping statistics --- None of the replies were delivered out of order. During the "fast" scp (8 seconds) I had no packet loss. I tries to run SCP over a different port (1235) in an attempt to see whether port 1234 would be throttled, but I get the same figures. So, thanks to you I realized that the problem is (a pretty significant?) packet loss, even though I am not sure, and probably can't find out, whether it's congestion caused or caused by the route switching. With that, is there anything I can do? Is this something Linode (or the German hoster) have any influence over? As in, could (and would) Linode choose a different route, or is it out of their hands anyway (in which case I wouldn't bother asking), because it's no longer in their network? Telia.net is in Stockholm, networklayer.com's whois information is proxied (Domains By Proxy), which strikes me a bit as odd, seeing hiding contact information is something I would only expect individuals to do. Still, who would have more influence over the route - Linode or the provider in Germany? |
|
| Author: | hoopycat [ Mon Dec 05, 2011 7:20 pm ] |
| Post subject: | |
Oh wow. TCP performance tends to decay pretty hard beyond about 5% packet loss, so the fact that it is working at all ought to be a pleasant surprise. Keep in mind that a lot of this is hidden from you because of a very large transmit buffer (see the Send-Q column on netstat -nt)... what looks smooth and constant from scp's perspective is very likely fits-and-starts under the hood. (scp really crams a lot into the sendq.) This is probably worth tickets from both ends. In general, contact the party/parties with whom you have a business relationship. Neither Softlayer (theplanet.com, networklayer.com) nor Global Crossing nor Telia will deal with you directly, so start from the ends. (This is also handy because, in all but the most trivial cases, the return path will be totally different than the forward path, and packet loss could occur on either with similar effect. Did the packet get lost on the way there, or did the acknowledgement get lost on the way here?) |
|
| Author: | mnordhoff [ Mon Dec 05, 2011 7:26 pm ] |
| Post subject: | |
hoopycat wrote: ... (This is also handy because, in all but the most trivial cases, the return path will be totally different than the forward path, and packet loss could occur on either with similar effect. Did the packet get lost on the way there, or did the acknowledgement get lost on the way here?)
...Use 2ping and find out! |
|
| Author: | Vance [ Tue Dec 06, 2011 2:50 am ] |
| Post subject: | |
hoopycat wrote: (scp really crams a lot into the sendq.)
If you use the -l (lower-case L) option, it seems to prevent scp from doing that. I've found it to be useful for getting more honest status reports from scp when transferring small files (which scp would normally just report 100% completion on immediately, as it's dumped the entire file into the send queue). |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|