[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Server goes to sleep



Chris Rhodin wrote: 
> Hi,
> 
> I've installed Debian Buster on a desktop system I use as a server.  I also
> occasionally use this as a regular desktop system so it has a monitor,
> keyboard, and GUI.  During installation I selected the ssh server in
> tasksel (so during installation there was some indication this was a
> server).
> 
> The problem I have is that when the console screen goes black and locks,
> the system becomes unresponsive to network activity.  If I have an ssh
> session running when this occurs it stops responding.  It doesn't kick me
> off, the ssh connection is still there.  If I then go to the console and
> shake the mouse the screen lights up and the ssh session starts responding
> like nothings wrong, until the console goes to sleep again.
> 
> Searching online I found this command which seems to solve the problem:
> 
> sudo systemctl mask sleep.target suspend.target hibernate.target
> hybrid-sleep.target
> 
> So my question is what is the correct way to manage this?  Is there a
> document that goes over the various power states and how they impact
> running services?

All modern processors have power-reduction features that operate
pretty much automatically when the system isn't being asked to
do anything. There are lots of tunables for more aggressive
savings. The powertop package can help you out there.

You don't have to worry much about those, but they won't
interfere with running a server.

Laptops, and most desktops, have sleep functions:

- sleep to RAM  
- sleep to disk and power-off
- hybrid sleep (first to RAM, then change to disk later)

You can't realistically run a server with those sleep states
activated.

Your desktop environment probably decided that it was OK to
sleep when you weren't active. It will have a control to turn
that behavior off.

-dsr-


Reply to: