I'm a beginner at linux server configuration and I don't have much knowledges about it. I use a linux ubuntu root server for a website with a postgres database. My operation system on my PC is windows 7.
After some minutes (I'm not quite sure, how long it takes, maybe 5 minutes or so, not a lot) without doing anything I lose my connection, which is really annoying. I googled how to fix it, but didn't really found a solution, or didn't understand them.
For example I tried to update my postgresql.conf and edited this values:
#tcp_keepalives_idle
#tcp_keepalives_interval
#tcp_keepalives_count
which didn't really help. I want to have to opportunity to idle for 30 minutes, without losing the connection.
Then I read another solution:
http://www.gnugk.org/keepalive.html
I honestly didn't really understand, what those lines I have to add, are for. Because when I check this:
sysctl -A | grep net.ipv4
it shows me:
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 7200
which should mean that I won't lose my connection for 2 hours, doesn't it?
I also don't really understand what does lines are for... Does that mean, that every service a client is connected, he will still be connected for 2 hours, even if he is inactive? No matter if it is for example postgresql or ftp or something?
Please help me! Thanks!
André
tcp_keepalives_idleandtcp_keepalives_intervalshould be lower than the idle time you want to have? Set them to 60 seconds for instance.