Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a pretty decent laptop (Intel Core i7-3520M CPU @ 2.90GHz, SataII SSD from Samsung, 8GB Ram), but I not satisfied with my boot and shutdown times... I have installed bootchart, and am trying to interpret it, but I don't understand some parts.

Bootchart output

In particular, I don't get what is happening during the first 10 seconds, when there is almost no CPU utilization, nor I/Os. What is happening then ? (there seem to be only udevd, modprobe and plymouth running).

On the other end of my daily work, I also experiente slow shutdown. No shotdown chart here, so I'm even more clueless...

Update I have come accross a hint saying hitting the up key while shutting down gives access to the console (I had been fighting with F1 / Alt F1 before that). So I have seen that the long shutdown time seems to have to do with rpcbind and modem-manager being unable to quit cleanly... Any idea?

Update 2 I have uninstalled rpcbind, as well as modemmanager. This made things better for shutdown, but I still have several seconds waiting between the 'All processes ended within 1 seconds' message, and the real shutdown. Just then, I get a quick message I was unable to read yet, but I suspect some sort of timeout to occur...

Update 3 Ok, I think I have narrowed things down to the execution of resume and wait-for-root during the first 10 seconds of the boot process. This is taking more than 5 secs, with no disk nor noticable CPU activity. I noticed that swap UUID in /etc/initramfs/conf.d/resume does not match with the real UUID of my swap partition, which happens to be... crypted. Maybe that is the point ? Any hint on initramfs-tools and cryptswap ?

share|improve this question
    
I know this is unrelated. But still I do not wanna miss suggesting to you to use suspend (to ram / to disk) as an alternative. From "off-state" to "running-state" this is less than 3 sec for my weaker system –  humanityANDpeace Jan 13 '13 at 11:13
1  
Suspend to disk is somehow not recommended when using SSD, as it implies writing the memory to disk each time... but you are right than resume from suspend to ram is quick. –  alci Jan 13 '13 at 12:35
    
I see that your booting times is ~20secs. Because I have no idea of SSD boot-up times and would love to know for future reference: What would be an acceptable boot-up time to you? –  Glutanimate Jan 13 '13 at 18:45
1  
I would expect aroud 15 seconds, maybe 10. My SSD is really quick, and my CPU is not bad, I think I can get the best out of it. To be frank, boot time is not that bad, but shutdown time is. That said, having removed rpcbind and modem-manager (did it today) has made things much better. I also think I understand the first 10 seconds of boot: it seems to be the time that happens in initramfs, with udev getting drivers loaded and /dev populated. Don't know if it can be much quicker... (see www.debian-administration.org/articles/620) –  alci Jan 13 '13 at 19:12
1  
it is good you made progress with the shutdown. Have you had some luck with the boot process? is UDEV the culprit? –  humanityANDpeace Jan 13 '13 at 21:00
show 1 more comment

2 Answers

up vote 12 down vote accepted

Ok, I have found the problem. As I was feeling, the 5 seconds waiting on resume and wait-for-root is not normal.

Googling around, I finally found this bug report: 5 second delay on wait-for-root

Essentially, it states that the 5 secs wait is due to a wrong entry in /etc/initramfs-tools/conf.d/resume.

It turns out that my swap is encrypted, and I had the initial installation UUID in /etc/initramfs-tools/conf.d/resume. I tried to put the one given by blkid for /dev/mapper/cryptswap1, but it didn't work...

I finally just commented out the entry in the file, and the 5 seconds delay is gone. Any way, hibernate is not enabled on my system (I think it is disabled by default in Ubuntu). Notice the # at the beginning of the entry.

#RESUME=UUID=3835540d-0cb4-46fc-b39a-de9ff88dcefd

then run:

sudo update-initramfs -u

So here is my latest bootchart:

bootchart

Much better. Regarding shutdown, removing rpcbind and modemmanager did the trick. I now have great boot and shutdown times.

share|improve this answer
1  
+1 for persistnecy –  bioShark Jan 15 '13 at 22:52
    
It is very nice to see you have discovered this wait_for_root etc swap related issue and managed to bring your boot time down. @alci regarding you "quite big 8GB" I was wondering what you use your PC for so that it makes sense to you to use a swap after all? Do you even ever use the swap partition , hence some application of yours is using > 8GB ram? wow? elsewise you might have avoided swap troubles by not using it in the first place. –  humanityANDpeace Jan 18 '13 at 9:53
1  
My swap is here because... I always had a swap with my Linux installs. And I always applied the old rule of thumb: swap size = ram size :-). Do I ever use more than 8Gb of RAM ? Normally not. But what would happen if I do and have no swap? And what is the cost of having a swap ? –  alci Jan 18 '13 at 10:47
add comment

Maybe you would want to consider installing your OS on RAM? If real speed is what you are after then that would be it. The difference between SSD loadtime and RAM loadtime is just huge.

share|improve this answer
15  
Cool idea, but I would find it slightly inconvinient to have to reinstall my OS each time I poweroff the RAM... :-) –  alci Jan 13 '13 at 13:31
    
Technically speaking, an installed system on RAM will vanish once you power off the machine –  Ed Villegas Jan 13 '13 at 13:54
    
Ofcourse, thats why you buy a UPS and never let it shutdown. –  Kaspar Jan 13 '13 at 16:37
    
Install your OS in RAM? memcache is already pushing it, but installing your OS? –  Linuxios Jan 16 '13 at 23:48
    
@ Linuxios I kind of did that once, copying an image of my <2.5GB /root parition to a tmpfs partition in ram. After the initial lengthy 2.5GB data copy it runs quite quickly. Still as @ Linuxios says the linux caching kind of achieves similar speeds. This comment is just to say: It is not absolutely crazy to have a linux run in RAM. It is doable. when copying back the image before shutdown it can even become a persistent thing :) –  humanityANDpeace Jan 18 '13 at 9:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.