Forum Discussion

cheezus_115419's avatar
cheezus_115419
Icon for Nimbostratus rankNimbostratus
May 07, 2013

Slow first outbound connection. Fast subsequent connections.

The problem is that the first outbound connection from a server to a host is very slow. The second and subsequent connections are very fast. We are testing wget 100m test files over http from various cdn providers.

 

For example if we download a large file to a server behind the viprions from linode. The first connection will download at approximately 100K/s. The second and subsequent connections will download at 5M/s (or sometimes much more).

 

Our test server is on a local subnet and vlan 10.10.220.0/24. The viprions have a floating ip address of 10.10.220.1. The router which both the viprions and the server physically connect has the vlan svi ip of 10.10.220.4. The server's gateway is the router of 10.10.220.4 We have policy based routing on this vlan that matches any IP traffic not destined for 10.10.220.0/24 and forwards it to the viprions floating ip of 10.10.220.1. The goal is to keep internal traffic off the viprions and only allow external traffic to go through them.

 

But this is when the first slow, second fast connection problems come into play. When the server's gateway is set to the floating ip on the viprions of 10.10.220.1 and the policy based routing is removed from the vlan, the first and subsequent connections are always fast. We can repeat this over and over, with any external host to download from.

 

I've done some tcpdumps and in the slow initial connection dump I see "continuation or non-http traffic" from the external host followed by test server sending RST. I'm not sure why that would be happening. But the viprion floating ip can directly reach the test server so there's probably some asymmetric routing where server -> router -> viprions -> external host. Then external host -> viprions -> server. Why it would only be slow on that initial connection is puzzling me...

 

I'm probably missing something simple and was wondering if it's jumping out at anyone reading this. Thanks for reading :)

 

14 Replies