Everything very slow after screenlock / suspend

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
Piers66
Level 1
Level 1
Posts: 18
Joined: Fri Dec 25, 2015 2:17 pm
Location: London, UK

Everything very slow after screenlock / suspend

Post by Piers66 » Wed May 30, 2018 9:28 am

Hello,

For the last few months, when I unlock my computer after the screensaver has kicked in and screen locked, everything is really slow. So slow, in fact, that it's usually quicker to shut down and restart than to open (for example) a new web page.

It seems to me that if the screen saver kicks in and I immediately jog the mouse to wake it back up then everything's fine, but if I leave it to the point where the screen locks and I need to enter my password that's when it gets really bad.

I'm running Linux on a Dell laptop sitting in a dock with an external screen, so it's normally on mains power.

System Info:
Linux Mint 17.3 Cinnamon 32-bit
Cinnamon version 2.8.8
Linux Kernal 3.19.0-32-generic
Processor Intel Core i5 CPU M 520 @ 2.40GHz x 2
Hard Drives 68.8GB

My screensaver settings are:
Lock The computer when put to sleep - ON
Lock the computer when the =screen turns off - ON
Delay before locking the screen - After 1 minute
Lock the computer when inactive - After 45 minutes

The Power Management settings are: (On A/C power)
Turn off the screen when inactive for - 30 minutes
Suspend when inactive for - Never

Any ideas what's happening?

Please note, I'm not an expert user, so please make any suggestions or requests for more info newbie-proof!

Thanks,

PIers.

User avatar
Flemur
Level 15
Level 15
Posts: 5787
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Everything very slow after screenlock / suspend

Post by Flemur » Wed May 30, 2018 4:23 pm

Piers66 wrote:
Wed May 30, 2018 9:28 am
For the last few months, when I unlock my computer after the screensaver has kicked in and screen locked, everything is really slow. So slow, in fact, that it's usually quicker to shut down and restart than to open (for example) a new web page.
Try opening two terminals before the screen locks, enter the commands below and leave the terminals open, then check their output after the slow unlock.

To check for CPU use, in one terminal enter:

Code: Select all

top
To check for memory/swap use, in the other terminal enter:

Code: Select all

watch free -m
Edit: you also might be able to just open a terminal and run those commands after the slow unlock.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

Piers66
Level 1
Level 1
Posts: 18
Joined: Fri Dec 25, 2015 2:17 pm
Location: London, UK

Re: Everything very slow after screenlock / suspend

Post by Piers66 » Sat Jun 02, 2018 8:54 am

Hello,

Thanks for the reply.

I've run the commands as you suggested, after a lock screen and when the computer had slowed down again. I don't know how to interpret the results, so have pasted them below for you to see.

Note that both Firefox and Thunderbird were running as well as the two terminal windows. While Firefox appears continuously in the 'top' window, Thunderbird comes and goes, and at the moment I copied the window contents it just happened to have gone from view.

Thanks,

Piers.

Code: Select all

-----------------------------------
'watch free -m' results:

Every 2.0s: free -m                                     Sat Jun  2 13:33:09 2018

             total       used       free     shared    buffers     cached
Mem:          1941       1745        195        128         46        590
-/+ buffers/cache:       1107        833
Swap:         3812        146       3666

-----------------------------------
'top' results:

top - 13:32:50 up  3:17,  3 users,  load average: 1.04, 1.84, 1.30
top - 13:34:39 up  3:18,  3 users,  load average: 0.32, 1.36, 1.19
Tasks: 186 total,   2 running, 183 sleeping,   0 stopped,   1 zombie
%Cpu(s):  0.8 us,  0.3 sy,  0.0 ni, 97.6 id,  1.3 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem:   1987764 total,  1842836 used,   144928 free,    49400 buffers
KiB Swap:  3904508 total,   149992 used,  3754516 free.   627224 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
 2077 piers     20   0  444652  91448  36748 S   2.3  4.6  11:01.61 cinnamon    
 3790 piers     20   0  202288  27768  22924 S   2.3  1.4   0:03.16 gnome-term+ 
 1307 root      20   0  293632  73224  65592 S   1.7  3.7   6:14.30 Xorg        
 3572 piers     20   0 1559800 714244  85688 S   1.0 35.9   4:29.33 firefox     
 1696 piers     20   0  285392  26840  25116 S   0.3  1.4   0:02.43 cinnamon-s+ 
 3464 root      20   0       0      0      0 S   0.3  0.0   0:01.74 kworker/u1+ 
 3814 piers     20   0    5624   2844   2448 R   0.3  0.1   0:00.93 top         
    1 root      20   0    4484   2940   2320 S   0.0  0.1   0:01.97 init        
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.01 kthreadd    
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.85 ksoftirqd/0 
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+ 
    7 root      20   0       0      0      0 S   0.0  0.0   0:15.41 rcu_sched   
    8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh      
    9 root      rt   0       0      0      0 S   0.0  0.0   0:00.27 migration/0 
   10 root      rt   0       0      0      0 S   0.0  0.0   0:00.07 watchdog/0  
   11 root      rt   0       0      0      0 S   0.0  0.0   0:00.06 watchdog/1  
   12 root      rt   0       0      0      0 S   0.0  0.0   0:00.29 migration/1 
   13 root      20   0       0      0      0 S   0.0  0.0   0:00.95 ksoftirqd/1 
   15 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/1:+ 
   16 root      rt   0       0      0      0 S   0.0  0.0   0:00.06 watchdog/2  
   17 root      rt   0       0      0      0 S   0.0  0.0   0:00.26 migration/2 
   18 root      20   0       0      0      0 S   0.0  0.0   0:00.59 ksoftirqd/2 
   20 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/2:+ 
   21 root      rt   0       0      0      0 S   0.0  0.0   0:00.06 watchdog/3  
   22 root      rt   0       0      0      0 S   0.0  0.0   0:00.54 migration/3 
   23 root      20   0       0      0      0 S   0.0  0.0   0:00.56 ksoftirqd/3 
   25 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/3:+ 
   26 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 khelper     
   27 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kdevtmpfs   
   28 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 netns       
   29 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 perf        
   30 root      20   0       0      0      0 S   0.0  0.0   0:00.01 khungtaskd  
   31 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 writeback   
   32 root      25   5       0      0      0 S   0.0  0.0   0:00.00 ksmd        
   33 root      39  19       0      0      0 S   0.0  0.0   0:01.03 khugepaged  
   34 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 crypto      
   35 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kintegrityd 
   36 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 bioset      
   37 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kblockd     
   38 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 ata_sff     
   39 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 md          
   40 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 devfreq_wq  
   45 root      20   0       0      0      0 S   0.0  0.0   0:03.43 kswapd0     
   46 root      20   0       0      0      0 S   0.0  0.0   0:00.00 fsnotify_m+ 
   47 root      20   0       0      0      0 S   0.0  0.0   0:00.00 ecryptfs-k+ 
   59 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kthrotld    
   61 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 acpi_therm+ 
   63 root      20   0       0      0      0 S   0.0  0.0   0:08.18 kworker/1:1 

User avatar
Flemur
Level 15
Level 15
Posts: 5787
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Everything very slow after screenlock / suspend

Post by Flemur » Sat Jun 02, 2018 9:35 am

Piers66 wrote:
Sat Jun 02, 2018 8:54 am
Note that both Firefox and Thunderbird were running as well as the two terminal windows. While Firefox appears continuously in the 'top' window, Thunderbird comes and goes, and at the moment I copied the window contents it just happened to have gone from view.

Code: Select all

             total       used       free     shared    buffers     cached
Mem:          1941       1745        195        128         46        590
-/+ buffers/cache:       1107        833
Swap:         3812        146       3666
-----------------------------------

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
 2077 piers     20   0  444652  91448  36748 S   2.3  4.6  11:01.61 cinnamon    
 3790 piers     20   0  202288  27768  22924 S   2.3  1.4   0:03.16 gnome-term+ 
 1307 root      20   0  293632  73224  65592 S   1.7  3.7   6:14.30 Xorg        
 3572 piers     20   0 1559800 714244  85688 S   1.0 35.9   4:29.33 firefox     
 1696 piers     20   0  285392  26840  25116 S   0.3  1.4   0:02.43 cinnamon-s+ 
The "top" looks OK (no real 100%-type CPU hogs), but you're running out of memory and using swap, which will make things slow; I think the general consensus is that 2G of memory ("Mem: 1941") isn't enough to run Cinnamon properly.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

Piers66
Level 1
Level 1
Posts: 18
Joined: Fri Dec 25, 2015 2:17 pm
Location: London, UK

Re: Everything very slow after screenlock / suspend

Post by Piers66 » Sat Jun 02, 2018 9:42 am

Hello,

I know the laptop is a bit old, but I've been running Linux since January 2016 and it's been fine most of the time. This problem has only been occurring for the last few months, but more importantly only occurs after a lock screen, so there must be something other than simply not enough RAM going on.

Would it be useful to post the same terminal results when it's running fine (i.e. right now)?

[EDIT]
You've bolded 'and using swap' as though it's a bad thing. Should I not be doing that (and if so what should my settings be?)
[/EDIT]

Piers.

User avatar
Flemur
Level 15
Level 15
Posts: 5787
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Everything very slow after screenlock / suspend

Post by Flemur » Sat Jun 02, 2018 10:13 am

Piers66 wrote:
Sat Jun 02, 2018 9:42 am
This problem has only been occurring for the last few months, but more importantly only occurs after a lock screen, so there must be something other than simply not enough RAM going on.
The RAM still might be the problem, just that there's something using it when it suspends.
Would it be useful to post the same terminal results when it's running fine (i.e. right now)?
Sure! The "free -m" would be good.
[EDIT]
You've bolded 'and using swap' as though it's a bad thing. Should I not be doing that (and if so what should my settings be?)
[/EDIT]
It is a bad thing. I have 4G, a very light fluxbox desktop and the few times I've used swap the system really slowed to a crawl, like it was broken.

There is a "swappiness" setting you might look at -
https://en.wikipedia.org/wiki/Swappiness

It look like firefox was using the most memory - perhaps try

Code: Select all

killall firefox
after you return from suspend - see if it makes any difference with the rest of the OS. When you re-start FF it should ask whether to restore the websites you were on when you killed it.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

Piers66
Level 1
Level 1
Posts: 18
Joined: Fri Dec 25, 2015 2:17 pm
Location: London, UK

Re: Everything very slow after screenlock / suspend

Post by Piers66 » Sat Jun 02, 2018 10:29 am

Hello,

OK, I'll try some of these things the next time it goes slow. Right now, however, I need a fast PC, so it'll have to wait till I've finished work!

Piers.

Post Reply

Return to “Cinnamon”