crik91
Posts: 13
Joined: Mon Mar 20, 2017 6:46 am

Very very slow boot time

Fri May 05, 2017 8:44 am

Hi, I have a Raspberry Pi 3 model B with Raspbian(latest version).
I have a really slow boot time: around 1 min and 10 seconds. What can I do to see why?

Thank you.

User avatar
RaTTuS
Posts: 10801
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Very very slow boot time

Fri May 05, 2017 9:14 am

Code: Select all

systemd-analyze blame
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
DougieLawson
Posts: 41900
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Very very slow boot time

Fri May 05, 2017 9:18 am

Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
topguy
Posts: 7240
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Very very slow boot time

Fri May 05, 2017 9:19 am

Systemd comes with its own analyzing tool.
https://wiki.archlinux.org/index.php/Im ... md-analyze

Probably faster than looking at the logs yourself.

Are you talking about booting into the logged in desktop ?

If you have a free uSD card lying around you could do a similar installation on it and compare.

crik91
Posts: 13
Joined: Mon Mar 20, 2017 6:46 am

Re: Very very slow boot time

Fri May 05, 2017 9:21 am

Here is the result:

Code: Select all

pi@raspberrypi:~ $ systemd-analyze blame
         19.406s plexmediaserver.service
         16.926s dhcpcd.service
          7.714s mysql.service
          7.568s nmbd.service
          7.328s samba-ad-dc.service
          7.065s hciuart.service
          5.978s proftpd.service
          5.761s bluetooth.service
          4.325s php5-fpm.service
          4.195s openmediavault-engined.service
          3.971s systemd-rfkill@rfkill1.service
          3.777s php7.0-fpm.service
          3.629s varnish.service
          3.509s systemd-fsck@dev-disk-by\x2dlabel-DiscoUsb.service
          2.595s transmission-daemon.service
          2.176s collectd.service
          2.176s collectd.service
          2.136s nginx.service
          2.114s systemd-udev-settle.service
          1.962s snmpd.service
          1.956s rrdcached.service
          1.050s smbd.service
           945ms user@0.service
           776ms systemd-logind.service
           724ms alsa-restore.service
           702ms lvm2-monitor.service
           696ms systemd-fsck@dev-disk-by\x2dlabel-DATI200.service
           684ms loadcpufreq.service
           682ms dphys-swapfile.service
           681ms monit.service
           678ms triggerhappy.service
           677ms tonido.service
           634ms avahi-daemon.service
           593ms rpcbind.service
           578ms phpsessionclean.service
           545ms keyboard-setup.service
           477ms quota.service
           468ms lvm2-activation-early.service
           451ms lvm2-activation.service
           438ms systemd-fsck@dev-disk-by\x2dpartuuid-0b82e3aa\x2d01.service
           430ms networking.service
           412ms openmediavault-beep-up.service
           354ms rsyslog.service
           346ms systemd-fsck-root.service
           342ms plymouth-start.service
           228ms mdadm-raid.service
           218ms console-setup.service
           201ms resolvconf.service
           190ms kbd.service
           181ms quotarpc.service
           180ms nfs-kernel-server.service
           177ms systemd-udev-trigger.service
           167ms srv-dev\x2ddisk\x2dby\x2dlabel\x2dDiscoUsb.mount
           162ms fake-hwclock.service
           152ms systemd-setup-dgram-qlen.service
           149ms kmod-static-nodes.service
           134ms systemd-tmpfiles-setup-dev.service
           134ms srv-dev\x2ddisk\x2dby\x2dlabel\x2dDATI200.mount
           130ms dev-mqueue.mount
           127ms systemd-journal-flush.service
           121ms sys-kernel-debug.mount
           118ms quotaon.service
           104ms hdparm.service
            92ms systemd-user-sessions.service
            86ms raspi-config.service
            82ms rc-local.service
            80ms user@1000.service
            78ms cpufrequtils.service
            72ms systemd-modules-load.service
            69ms systemd-remount-fs.service
            64ms systemd-random-seed.service
            59ms plymouth-read-write.service
            53ms systemd-tmpfiles-clean.service
            48ms systemd-sysctl.service
            47ms proc-sys-fs-binfmt_misc.mount
            44ms systemd-rfkill@rfkill0.service
            44ms openmediavault-cleanup-php.service
            44ms systemd-tmpfiles-setup.service
            43ms openmediavault-cleanup-monit.service
            40ms sys-kernel-config.mount
            36ms systemd-update-utmp.service
            32ms plymouth-quit-wait.service
            29ms plymouth-quit.service
            28ms boot.mount
            25ms sys-fs-fuse-connections.mount
            23ms systemd-udevd.service
            18ms systemd-quotacheck.service
            16ms systemd-update-utmp-runlevel.service
            16ms tmp.mount
            12ms udev-finish.service
I need about 2 min to reboot and re-log via SSH.

MESSAGE UPDATED: sorry, some rows were missing.

User avatar
topguy
Posts: 7240
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Very very slow boot time

Fri May 05, 2017 9:31 am

Clearly not a clean Raspbian Jessie boot, thats for sure.
- Samba
- Plex
- BitTorrent
- FTP
- Openmediavault (another media server)
- MySql
- Varnish ( http proxy/caching? )
- tonido (cloud)

I'm almost impressed it boots at all ;-)

crik91
Posts: 13
Joined: Mon Mar 20, 2017 6:46 am

Re: Very very slow boot time

Fri May 05, 2017 1:03 pm

What do you mean with "not a clean Raspbian"?
I don't remember having installed Varnish.

"I'm almost impressed it boots at all", I'll take that as a compliment. :D It was an hard job to run all those things together!
So, the boot time is something like "normal"?

User avatar
Gavinmc42
Posts: 6307
Joined: Wed Aug 28, 2013 3:31 am

Re: Very very slow boot time

Fri May 05, 2017 1:10 pm

So, the boot time is something like "normal"?
Sorry, but that's not normal ;)
Talk about pushing Pi's to the max :lol:
You are overclocking and watercooling?

Could be you need a new SDcard too, nice fast one.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

crik91
Posts: 13
Joined: Mon Mar 20, 2017 6:46 am

Re: Very very slow boot time

Fri May 05, 2017 1:25 pm

Not overclocked or watercooled. I have not any cooling system: not fans, not heat sinks... Normally stay at 44 degrees(Celsius).

What can I do to speed up?
I'm using an 80 MB/s MicroSD card.

Thank you

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 30157
Joined: Sat Jul 30, 2011 7:41 pm

Re: Very very slow boot time

Fri May 05, 2017 1:39 pm

Gavinmc42 wrote:
So, the boot time is something like "normal"?
Sorry, but that's not normal ;)
Talk about pushing Pi's to the max :lol:
You are overclocking and watercooling?

Could be you need a new SDcard too, nice fast one.
Please try to keep within the realms of sensible...

No reason why the Pi would need overclocking and watercooling under thee circumstances.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

crik91
Posts: 13
Joined: Mon Mar 20, 2017 6:46 am

Re: Very very slow boot time

Fri May 05, 2017 1:40 pm

And I don't want/need to overclock. I just want to know if I have something wrong in my Raspbian that make all slow.

Thanks

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 30157
Joined: Sat Jul 30, 2011 7:41 pm

Re: Very very slow boot time

Fri May 05, 2017 1:40 pm

crik91 wrote:What do you mean with "not a clean Raspbian"?
I don't remember having installed Varnish.

"I'm almost impressed it boots at all", I'll take that as a compliment. :D It was an hard job to run all those things together!
So, the boot time is something like "normal"?
It means it is not a freshly installed SD card, you have installed quite a lot of other stuff on it.

It appears all that stuff you have installed is slowing down boot time. Following advice above, find out which is slowing it down.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

crik91
Posts: 13
Joined: Mon Mar 20, 2017 6:46 am

Re: Very very slow boot time

Fri May 05, 2017 1:43 pm

Exactly, is what I mean. I have a lot of things installed and I don't know what is slowing down at all.
Is there a way to see the log file? The systemd analyzer tool is not enough I think...

User avatar
RaTTuS
Posts: 10801
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Very very slow boot time

Fri May 05, 2017 1:52 pm

it is exactly what you need
see also
dmesg
..
personally I'd start with a fresh raspbian lite and load what you need and see how fast thing go as you add stuff
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
topguy
Posts: 7240
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Very very slow boot time

Fri May 05, 2017 2:27 pm

crik91 wrote:The systemd analyzer tool is not enough I think...
it tells you exactly what you asked for.

* Plex server takes 20 seconds to load, that seems quite reasonable to me.
* That dhcpd uses 16 seconds seems a little high actually. Try setting a static IP if that is not already done.
* Dont use Bluetooth ? disable the Bluetooth.service, save another 6 seconds.

ktb
Posts: 1447
Joined: Fri Dec 26, 2014 7:53 pm

Re: Very very slow boot time

Fri May 05, 2017 2:37 pm

If a better visual of the processes helps, you can also use

Code: Select all

systemd-analyze plot > ~/plot.svg
That will create an SVG image in your home directory showing a timeline of everything starting up. You can open the image in chromium-browser or an image viewing/editing application.

User avatar
bensimmo
Posts: 5491
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Very very slow boot time

Fri May 05, 2017 2:44 pm

Well the first five take about a minute and 10 almost a minute and a half.

I don't know if any of these are setup in parallel with the 4cores?

Either way, as above it's all that stuff loading.
You could try running your SD card are the faster UHS1 rate (search overclocking SD card on a pi)
Assuming it's a good card, UHS1 rated like a Samsung EVO/evo+ it should be fine.

Look at moving to a usb drive, be it SSD, pendrive or good old hard drive.

Check you've not used up the 1GB of RAM somehow..

ktb
Posts: 1447
Joined: Fri Dec 26, 2014 7:53 pm

Re: Very very slow boot time

Fri May 05, 2017 3:04 pm

One other thing that sometimes can speed up boots is converting/replacing/overriding older SysVinit scripts to systemd unit files.

crik91
Posts: 13
Joined: Mon Mar 20, 2017 6:46 am

Re: Very very slow boot time

Fri May 05, 2017 3:35 pm

ktb wrote:If a better visual of the processes helps, you can also use

Code: Select all

systemd-analyze plot > ~/plot.svg
That will create an SVG image in your home directory showing a timeline of everything starting up. You can open the image in chromium-browser or an image viewing/editing application.
Done, there are several process related to the list of apps in the previous post.

Return to “Troubleshooting”