You are not logged in.

#1 2011-11-26 17:44:08

naxan
Member
From: Denver, CO
Registered: 2010-09-11
Posts: 24
Website

[SOLVED] Weird TCP Timeout Issues

Okay, I've got a stumper for everyone:

I have an old Lenovo X200 laptop running Arch x64 that I currently use as a server. Everything seems to work well, except that the system has trouble reliably establishing OUTBOUND connections. In particular, I experience frequent timeouts when attempting to pull data over the network using pacman, wget, curl, and elinks. I've also noticed (though I'm not sure that these are related) that the Tor node I run consistently under-utilizes the bandwidth I've allocated to it, and bittorent performance (deluged is also running) seems poor.

However, there are no such issues revolving around INBOUND connection requests (i.e., HTTP, IMAP, etc.). Moreover, the server does not appear to exhibit these issues when requesting data from systems on its local network or over OpenVPN. It's just out-of network resources.

Things I've tried to far:

  • I've tried various combinations of nameservers in /etc/resolv.conf, as well using both dnsmasq and pdnsd as a local caching nameserver. In all cases the problem has persisted; moreover, I can successfully resolve the services I'm trying to pull data from before hand, and still experience timeouts when I actually request a file.

  • I've tried disabling IPv6.

  • I've tried increasing the number of available file descriptors (despite the fact that it looks like I'm nowhere near the limit).

  • I've tried setting net.ipv4.tcp_window_scaling = 0 in /etc/sysctl.conf (I remember reading somewhere that this had helped other folks with seemingly similar issues).

  • I've tried plugging the server into different ports on my DSL modem (that said, neither my everyday laptop (running Arch i686) nor my girlfriend's laptop (WinXP) experience these issues, whether connected via wireless or ethernet to the same network).

None of these approaches has resolved the issue. Interestingly enough, if I request data from a server (say, by running "curl http://aur.archlinux.org/index.php" repeatedly), eventually the request will go through. After that, any tool I have can talk to the remote system without difficulty, at least for a few hours.

I'm completely out of ideas here. Any Arch gurus who can suggest something else I can try, or anyone else at all who's had a similar problem?

Thanks.

Last edited by naxan (2012-01-07 22:46:10)


For I dipt into the future, far as human eye could see,
Saw the Vision of the world, and all the wonder that would be...

Offline

#2 2011-11-26 18:11:17

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] Weird TCP Timeout Issues

There's a few options in /etc/sysctl.conf to try:

# http://linux.die.net/man/7/tcp
# Assume that no receipt of a window-scaling option means that the remote TCP is broken and treats the window as a signed quantity.
net.ipv4.tcp_workaround_signed_windows = 1

# From http://en.gentoo-wiki.com/wiki/Iptables/Iptables_and_stateful_firewalls#Traditional_firewall_bummers
# Some Internet routers don't support this, so safer off. Defaults to 2.
net.ipv4.tcp_ecn = 0

# Do not accept source routing
# http://bec.at/support/ipsysctl-tutorial/theconfvariables.html
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.accept_redirects = 0

# Controls the use of TCP syncookies
# These are bad - http://it.slashdot.org/article.pl?sid=08/10/01/0127245
net.ipv4.tcp_syncookies = 0

# Dynamic IP address
net.ipv4.ip_dynaddr = 1

# http://linux.die.net/man/7/tcp
net.ipv4.tcp_low_latency=1

net.ipv4.tcp_rfc1337=0

# sysctl -A | grep ipv4
# From http://en.gentoo-wiki.com/wiki/TCP_Tuning
net.ipv4.tcp_no_metrics_save = 1

# tcp_window_scaling - http://wiki.mandriva.com/en/2008.1_Errata
# Try 0 if Internet is slow
net.ipv4.tcp_window_scaling = 1

# From http://duopetalflower.blogspot.com/2009/11/tuning-ubuntu-910-karmic-for-speed-and.html
net.ipv4.tcp_rmem=4096 65536 65536
net.ipv4.tcp_wmem=4096 65536 65536

Offline

#3 2011-11-27 19:34:01

naxan
Member
From: Denver, CO
Registered: 2010-09-11
Posts: 24
Website

Re: [SOLVED] Weird TCP Timeout Issues

As fate would have it, I was already using a couple of the settings you mention.

Unfortunately, none of them seem to make a difference, either together, apart, or in combination. The weird data transfer lags persist.

That said, the TCP buffer tweaks seem to make webpages load faster when they do load, so I suppose that's something.


For I dipt into the future, far as human eye could see,
Saw the Vision of the world, and all the wonder that would be...

Offline

#4 2012-01-07 22:45:50

naxan
Member
From: Denver, CO
Registered: 2010-09-11
Posts: 24
Website

Re: [SOLVED] Weird TCP Timeout Issues

Solved! See "Some websites won't connect/load" for a solution that worked for me.

Looks like DSL modems suck.


For I dipt into the future, far as human eye could see,
Saw the Vision of the world, and all the wonder that would be...

Offline

Board footer

Powered by FluxBB