suggestions for debugging slow logout/shutdown

Archived topics about LMDE 1
Locked
wilo108
Level 1
Level 1
Posts: 28
Joined: Sat May 07, 2011 1:02 pm

suggestions for debugging slow logout/shutdown

Post by wilo108 » Fri Mar 14, 2014 4:43 pm

Hi folks,

my new installation of LMDE (64bit, Cinnamon) is painfully slow to logout and shutdown. it's lovely and snappy to start and very responsive (and I love it to bits), and generally noticeably faster than the Mint 15 Olivia installation I was using on the same laptop previously. the Mint 15 installation would logout and shutdown considerably faster, though.

i am hoping someone here might be able to offer some suggestions as to how to profile/debug the logout and shutdown process so that I can try to work out what's causing the problem. i've not found anything obviously relevant in the log files i've checked, and while the internet has lots of articles about debugging systemd, i can't find anything specific about doing the same with sysvinit. but i think Cinnamon might be the bigger problem anyway. after clicking shutdown on the Cinnamon menu, my desktop and panel icons all revert to gnome defaults, and then i get to look at that for somewhere between 10 and 20 seconds (sometimes longer), before the plymouth splash appears.

if anyone can suggest what might be causing this problem, or where i might look for clues, i will be very grateful!

thanks!

wilo

User avatar
gtsfer
Level 7
Level 7
Posts: 1925
Joined: Mon May 27, 2013 9:15 am
Location: Bucks County PA, USA

Re: suggestions for debugging slow logout/shutdown

Post by gtsfer » Fri Mar 14, 2014 4:58 pm

I'm not sure where to start but this doesn't seem normal. Shutdown is generally really fast on Linux Mint (I had 15 installed before) and it's just terrific on LMDE.

I don't see any of what you're describing on my system. Complete shutdown takes way under 10 seconds on my 5 year old Dell dual core 2.8 Ghz machine. You've looked at the right things for starters so somebody more guru-ish needs to jump in to diagnose this.

You said it's a new install. And that it was faster to shutdown with v15 Olivia. Can you look at your filesystems, see if they appear as expected (like ext 4 or whatever in Gparted or whatever)? It sounds like a flakey install especially if it was faster before w v15 too.
"There is no gravity, the earth sucks." - Issac Newton @ 75
KDE & Cinnamon 18.1 & Win 10 - ASUS M5A99FX PRO MB, AMD FX-8370 Octo-Core CPU, 16GB RAM, AMD Radeon R7 240

wilo108
Level 1
Level 1
Posts: 28
Joined: Sat May 07, 2011 1:02 pm

Re: suggestions for debugging slow logout/shutdown

Post by wilo108 » Fri Mar 14, 2014 6:49 pm

hi gtsfer, thanks for the response. indeed, i don't think this is normal, which is why i'd like to try to identify the culprit. i do have a number of (relatively) uncommon services installed, including MySQL and PostgreSQL, redis, nginx, and so on. most of these are not running all the time though (`update-rc.d -f <service> remove`). systemd has a way of profiling the shutdown sequence, but i don't think there's anything similar for sysvinit. and i'm not even sure this is where the problem is.

User avatar
gtsfer
Level 7
Level 7
Posts: 1925
Joined: Mon May 27, 2013 9:15 am
Location: Bucks County PA, USA

Re: suggestions for debugging slow logout/shutdown

Post by gtsfer » Fri Mar 14, 2014 7:43 pm

I've got a few uncommon services running too, no problems. Do you remember if it was this way right after the install? Or if it got this way later on in time.

See if somebody else picks up on your post after a day or so. If not maybe we can call attention to it with some heavy hitters on the forums. I've seen guys with 1500 or more posts. One even with 21,000 = a level 21. These guys are actively involved on here. I kind of a newbie trying to learn by helping w what little I know.
"There is no gravity, the earth sucks." - Issac Newton @ 75
KDE & Cinnamon 18.1 & Win 10 - ASUS M5A99FX PRO MB, AMD FX-8370 Octo-Core CPU, 16GB RAM, AMD Radeon R7 240

wilo108
Level 1
Level 1
Posts: 28
Joined: Sat May 07, 2011 1:02 pm

Re: suggestions for debugging slow logout/shutdown

Post by wilo108 » Sat Mar 15, 2014 12:30 am

just to see if it would make a difference, i removed sysvinit and installed systemd, and while it's made the startup and shutdown quicker, i still have the 10-20 seconds hang logging out of Cinnamon :( I also installed the new beta version of MDM (1.5.1+lmde) to see if that would help, but alas no... :( still hoping to get some pointers!

User avatar
gtsfer
Level 7
Level 7
Posts: 1925
Joined: Mon May 27, 2013 9:15 am
Location: Bucks County PA, USA

Re: suggestions for debugging slow logout/shutdown

Post by gtsfer » Sat Mar 15, 2014 7:47 am

That's still way too slow. Something is afoot. It's Saturday and your post is up top there in the "new" ones. Let's wait a bit and see if a guru bites on this.

Bingo! Listen to this guy kurotsugi. He's a level 5. I'm a lowly newbie. :oops:
Last edited by gtsfer on Sat Mar 15, 2014 1:09 pm, edited 1 time in total.
"There is no gravity, the earth sucks." - Issac Newton @ 75
KDE & Cinnamon 18.1 & Win 10 - ASUS M5A99FX PRO MB, AMD FX-8370 Octo-Core CPU, 16GB RAM, AMD Radeon R7 240

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: suggestions for debugging slow logout/shutdown

Post by kurotsugi » Sat Mar 15, 2014 12:21 pm

if you have systemd, we can start with

Code: Select all

systemd-analyze blame
systemd-analyze critical-chain

you can also see the bootlog in /var/log to investigate further

wilo108
Level 1
Level 1
Posts: 28
Joined: Sat May 07, 2011 1:02 pm

Re: suggestions for debugging slow logout/shutdown

Post by wilo108 » Sat Mar 15, 2014 10:45 pm

thanks folks. as I mentioned, i removed `sysvinit` in favour of `systemd`, and that's gone well. `systemd-analyze` reports a very reasonable time:

Code: Select all

Startup finished in 6.196s (kernel) + 5.855s (userspace) = 12.052s
`systemd-analyze critical-chain` looks like this:

Code: Select all

graphical.target @5.850s
└─multi-user.target @5.850s
  └─psd.service @2.585s +3.265s
    └─basic.target @2.580s
      └─sockets.target @2.580s
        └─dbus.socket @2.580s
          └─sysinit.target @2.578s
            └─mintsystem.service @1.676s +902ms
              └─dbus.service @2.957s
                └─basic.target @2.580s
                  └─...
so no problems there.

The issue seems to be with Cinnamon somewhere, but I'm not sure where, or how to go about tracking it down. ~/.xsession-errors doesn't contain anything useful or relevant, I think.

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: suggestions for debugging slow logout/shutdown

Post by kurotsugi » Sat Mar 15, 2014 11:38 pm

I see :3
the problem is on cinnamon. using newest mdm won't solve the problem. the solution will be to not use cinnamon at all.

User avatar
gtsfer
Level 7
Level 7
Posts: 1925
Joined: Mon May 27, 2013 9:15 am
Location: Bucks County PA, USA

Re: suggestions for debugging slow logout/shutdown

Post by gtsfer » Sun Mar 16, 2014 12:24 pm

I'm curious then. Are you saying Cinnamon is inherently slower than Mate in this way sometimes? I run LMDE Mate 64 myself. But I'll stay away from Cinnamon in the future if this is the case.
"There is no gravity, the earth sucks." - Issac Newton @ 75
KDE & Cinnamon 18.1 & Win 10 - ASUS M5A99FX PRO MB, AMD FX-8370 Octo-Core CPU, 16GB RAM, AMD Radeon R7 240

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: suggestions for debugging slow logout/shutdown

Post by kurotsugi » Sun Mar 16, 2014 1:21 pm

@wilo108: I forget to tell you that we can make systemd load the system faster by activating readahead mechanism. in my case my boot time was decreased by ~10 seconds. :3
@gtsfer: the DE itself is quite fast but it takes long time to load the DE on boot. the culprit is actually muffin and hw accelerated rendering mode. you can get a faster load by using software rendering mode but it might not the solution you wanted for. anyway, since you're using mate it means you have different problem with wilo108. you'll need to debug your system to find the culprit. I believe there was a tool called bootchart to analyze boot process on sysvinit.

wilo108
Level 1
Level 1
Posts: 28
Joined: Sat May 07, 2011 1:02 pm

Re: suggestions for debugging slow logout/shutdown

Post by wilo108 » Sun Mar 16, 2014 10:09 pm

@kurotsugi -- yes, I used readahead as a matter of course on any system i install.

as far as Cinnamon goes, let me reiterate to make sure i'm clear: there is no problem for me with Cinnamon load time (and never has been since 1.4). i currently have a specific issue on this LMDE install with the Cinnamon logout / shutdown time that I'm looking to debug. i've never had this problem with Cinnamon before (on LMDE or on LM14, 15, 16) -- in fact, my partner is currently running Cinnamon on LM16 and the shutdown time is really remarkably fast (which is one reason why i'm trying to do something about this: a) i know there is no good reason why it should have to be so slow; and b) i'm jealous of her shutdown times!).

My suspicion is that it's to do with some settings or addons (applets or themes) that i'm using, or something along those lines. i'll begin the tedious process of methodically and systematically disabling things one-by-one, and trying to isolate the culprit. i had hoped that there might be a less tedious and more targeted way of narrowing down the issue.

thanks!

User avatar
gtsfer
Level 7
Level 7
Posts: 1925
Joined: Mon May 27, 2013 9:15 am
Location: Bucks County PA, USA

Re: suggestions for debugging slow logout/shutdown

Post by gtsfer » Mon Mar 17, 2014 6:00 am

Thanks...
kurotsugi wrote:@gtsfer: the DE itself is quite fast but it takes long time to load the DE on boot. the culprit is actually muffin and hw accelerated rendering mode. you can get a faster load by using software rendering mode but it might not the solution you wanted for. anyway, since you're using mate it means you have different problem with wilo108. you'll need to debug your system to find the culprit. I believe there was a tool called bootchart to analyze boot process on sysvinit.
But my system doesn't have this problem. :) My boot up time is fine. And shutdown takes about 7 seconds. I'm going to look at "bootchart" just so I can learn more about the process.
"There is no gravity, the earth sucks." - Issac Newton @ 75
KDE & Cinnamon 18.1 & Win 10 - ASUS M5A99FX PRO MB, AMD FX-8370 Octo-Core CPU, 16GB RAM, AMD Radeon R7 240

jewnersey
Level 1
Level 1
Posts: 20
Joined: Mon Jun 11, 2012 6:19 pm

Re: suggestions for debugging slow logout/shutdown

Post by jewnersey » Wed Aug 20, 2014 5:18 pm

have you made any progress on this?

I am experiencing the same issue (10 second boot time from cold, 25+ seconds to logout/shutdown)

User avatar
reference2myself
Level 2
Level 2
Posts: 91
Joined: Sat Sep 18, 2010 10:44 am

Re: suggestions for debugging slow logout/shutdown

Post by reference2myself » Thu Dec 04, 2014 12:02 pm

I've experienced this problem at times too. It wasn't every time for me, but on occasion when I would try to log out or shut down it would hang for a minute before it did anything. I'm currently not seeing that problem after updating to betsy with cinnamon 2.4.3 (not recommended for the inexperienced) so hopefully when LMDE 2 is out it will no longer be an issue for people. I always suspected it was a problem with some service not shutting down right away.

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: suggestions for debugging slow logout/shutdown

Post by kurotsugi » Thu Dec 04, 2014 2:12 pm

there is some missing post in this thread. please allow me explain. the boot time, showed by 'systemd-analyze time' is different with the times needed to load cinnamon. we don't have problem with cinnamon in mint main version but we do have some problem with cinnamon in LMDE. there was a bug in muffin which makes cinnamon on LMDE take longer time to load. this issue IIRC is introduced on cinnamon 1.6 and theorically it should have been fixed on current newest cinnamon. it's exactly the reason why newest cinnamon doesn't have this problem
I'm currently not seeing that problem after updating to betsy with cinnamon 2.4.3
since you're on LMDE your solution is:

1. build your own cinnamon 2.4 on current UP.
2. ask mint team to provide an UP with newest cinnamon.
3. don't use cinnamon.

the bad news, (1) no one can guarantee cinnamon 2.4 could work on current UP. the development gap between current UP and the GTK version needed to build cinnamon is quite wide. (2) you won't get any updates - bug fixes - nor security updates on LMDE since mint team officially won't provide system maintenance to this distro until jessie becomes stable. there won't be next UP since mint team insisted to left LMDE user with their problem. your last choice, if you insisted using LMDE and avoid this issue is "don't use cinnamon".

py-thon
Level 4
Level 4
Posts: 317
Joined: Fri Sep 27, 2013 2:24 pm
Location: Paraguay

Re: suggestions for debugging slow logout/shutdown

Post by py-thon » Thu Dec 04, 2014 2:56 pm

kurotsugi wrote:if you insisted using LMDE and avoid this issue is "don't use cinnamon".
Even though I don't use Cinnamon I would consider this step somewhat drastic to avoid a 10 to 20 second delay on shutdown :D
Tower: Sparky 64 bit Mate+mintmenu - Netbook: Sparky 32 bit Mate+mintmenu

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: suggestions for debugging slow logout/shutdown

Post by kurotsugi » Thu Dec 04, 2014 5:05 pm

well...there're reasons why I give alternatives instead of one solution, and I deliberately put it as the last option. he can choose one of the proposed solution based on his needs, and the last solution also doesn't means that he should _permanently_ not using cinnamon. it's just just a termporary solution to avoid the issue. when lmde receives newer cinnamon this issue will get resolved, and he can use cinnamon again :3

kpatient
Level 1
Level 1
Posts: 1
Joined: Wed Jul 22, 2015 1:28 pm

Re: suggestions for debugging slow logout/shutdown

Post by kpatient » Wed Jul 22, 2015 1:32 pm

Bit late to the party, however this might be a simpler solution for people encountering the same problem.

I've found that using the bash command

Code: Select all

shutdown -h now
turns my machine off in less than 2 seconds. Maybe you could make a script with this instead.

Locked

Return to “LMDE 1 Archive”