Remedies to server connection issues
Posted by Wesley on
I've reported about the server losing connection after a bit of idling time yesterday, and the culprit was the power management settings. Surprisingly, my Mac mini was set to go into power saving mode just ten minutes after idling. I'm not sure what kept it up before, but it certainly isn't kept awake now. So I set the setting to never go fall asleep. Now the connection doesn't drop.
I thought this was the end of troubles, but it turns out that the server now takes a long time to respond after several minutes of idling. Once it responds, subsequent pages load just fine. I haven't found out why this was the case, but I know it's not a DNS lookup issue because there's no delay while there is network activity on the Mac.
So I devised a way to work around this issue by automatically causing a small network activity every minute. After opening Terminal:
[Press "!wq"]
And that's it. Once this is done, the system starts doing a ping once every minute silently. So far, it's working nicely and the website loads fine regardless of idling time.
I thought this was the end of troubles, but it turns out that the server now takes a long time to respond after several minutes of idling. Once it responds, subsequent pages load just fine. I haven't found out why this was the case, but I know it's not a DNS lookup issue because there's no delay while there is network activity on the Mac.
So I devised a way to work around this issue by automatically causing a small network activity every minute. After opening Terminal:
crontab -e[Press "i"]
00-59 * * * * /sbin/ping -c 1 -n google.com > /dev/null/[Press "Esc" button]
[Press "!wq"]
And that's it. Once this is done, the system starts doing a ping once every minute silently. So far, it's working nicely and the website loads fine regardless of idling time.