xlock too slow to wake up

Paul Smith paul at mad-scientist.net
Fri May 18 12:55:35 UTC 2012


> On 18 May 2012 08:18, oxy <oxyopes at googlemail.com> wrote:
> 
> > Everyday i come to my office and have to wait for a looong
> > time shaking the computer to get xlock give me the passwd
> > prompt. Why not improve that? A priority matter?
> >
> > Ubu 12.04/Unity, using the standard unity "Lock Screen"
> > (Ctrl Alt L) function.

A more specific definition of "a looong time" would be helpful.  What
seems a long time to you might not seem long to us.  Is it 10 seconds?
1 minute?  10 minutes?

You say it only happens when you unlock in the morning: that's a big
clue.  If you lock the system and go to lunch, meetings, etc. then come
back after an hour or two and unlock is it slow then?

I strongly suspect that it's nothing to do with power management, but
rather normal behavior.  I suspect you have either not enough memory in
your system for the workload you're running, and/or you added too much
swap space.

Remember that memory in your computer is not just used for your
programs.  It's also used by the kernel to support things like disk
caching (so disk IO will be faster).  On any GNU/Linux system, there are
a lot of bookkeeping processes that run overnight, and some of them do
things like walk your entire disk drive (to support the locate database
for example, or if you have any backup software running).  Also some of
them may use a lot of memory while they are running, pushing other
programs out to swap, then exit freeing that memory... but your programs
are already swapped out.

Because all your normally-running programs are idle, the kernel will
feel free to swap out your programs and use the resulting memory for
these bookkeeping processes/disk caching.  "Swapping out", FYI, means
that the in-memory content of your programs are written to disk (that's
what swap space is, disk space reserved to hold memory overflow).  Then
when you come in in the morning and press a key to wake up your programs
the kernel has to swap them back in again (read them out of disk swap
space and into memory).  This can take a long time (relatively
speaking).

So the less free memory you have for disk caching/bookkeeping programs,
and/or the more swap space you have to allow the kernel to swap out
memory, the more of your programs are swapped out in the morning and the
longer it takes to swap it all back in again before they can run.

So, useful information for us would be, how long does the system take to
wake up in the morning?  How much memory do you have in the system?  How
large is your swap space?

If your system is running OK otherwise, you might just need to get used
to pressing some keys to wake it up, then going to get your morning tea
or coffee etc. while it swaps in.  The alternative would be to buy more
memory, or reduce your swap space.  I wouldn't recommend trying to turn
off the bookkeeping processes.





More information about the ubuntu-users mailing list