This question already has an answer here:
I am using my raspberry pi as a headless server. The problem is that after a couple of hours of inactivity it seems to enter a power suspend state where it disappears from the web and refuses ssh connections. After having prodded it via ssh it comes back after a couple of minuttes and uptime informs that it has been alive all the while. This makes me think it is some kind of power management scheme that is in effect but I have read other places that the pi is not able to suspend.
Does anyone have an idea what is wrong?
After having spent a great deal of time trying to figure this out it seems a number smaller issues have helped:
- Configure postfix to not use ipv6.
- Use fail2ban to blacklist ssh login attempts.
- Update firmware on router.
All three items seems to have had a positive effect on the pi's uptime. It is now reasonably stable and I have not the login-problem for about three weeks.