WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Slow boot  (Read 2197 times)

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Slow boot
« on: August 03, 2020, 08:45:41 PM »
First time user.  Raspberry Pi4 2gb.

Like it so far.  Only installed a gui.  In onboot.lst I have:
mc.tcz
openssh.tcz
libgrypt.tcz
TC.tcz

What takes the longest is loading extensions.  To get to a desktop I get 22 seconds, pretty much about what I get with DietPi (well, its about 19 sec).

Is there a way to speed it up?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14309
Re: Slow boot
« Reply #1 on: August 03, 2020, 10:13:34 PM »
You could experiment with making one big extension out of the deps of the TC extension.

Offline ashfame

  • Full Member
  • ***
  • Posts: 112
Re: Slow boot
« Reply #2 on: August 04, 2020, 05:04:52 AM »
I am in the same boat. Takes up 45 seconds to boot for me on Raspberry Pi 2B (1GB). Seems slow for loading ~400MB files into the ram based filesystem even when SD card is pretty high speed one. Not sure what's causing the bottleneck.

You could experiment with making one big extension out of the deps of the TC extension.

Hi Juanito,

Does the tcz files are extracted first and then loaded into memory fs or they are loaded first in the memory fs and then extracted? Seems former, and would make sense as number of files being a factor but your suggestion seems to suggest the latter. Can you elaborate how that could make a difference?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10812
Re: Slow boot
« Reply #3 on: August 04, 2020, 05:17:03 AM »
Hi ashfame
Add the following boot codes:
Code: [Select]
printk.time=1 syslogThen reboot. Go to  /var/log.  attach the messages  file to your next post. If there is a  messages.0  file, attach that too.
Those files will contain timing information.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 994
Re: Slow boot
« Reply #4 on: August 04, 2020, 05:54:54 AM »
What does /tmp/bootlog.txt show?

tcz's are not extracted, unless you are using copy2fs flag.  Extensions are squashfs read only file systems that get loop mounted.  Currently every extension has to be mounted one by one......making a single big extension reduces the amount of mounting stages.

Offline ashfame

  • Full Member
  • ***
  • Posts: 112
Re: Slow boot
« Reply #5 on: August 04, 2020, 06:19:23 AM »
What does /tmp/bootlog.txt show?

tcz's are not extracted, unless you are using copy2fs flag.  Extensions are squashfs read only file systems that get loop mounted.  Currently every extension has to be mounted one by one......making a single big extension reduces the amount of mounting stages.

Hi Paul,

It looks like:

Code: [Select]
0.1 - Build TCZ list
7.1 - Mount TCZ (95)
28.9 - Add to file system
4.1 - Execute startup scripts
0.1 - udev trigger

So a lot of time is indeed going for copying files to file system by extracting tcz files as I am indeed using copy2fs.flg

And same is shown in detail at `/var/log/messages` as Rich suggested to check after adding that bootcode.

Lots of mount & busybox commands slowly with every second, not like something is holding up & everything else is fast. I would have provided the log file itself but I don't have networking enabled so I can't export the log file easily. But I will click pictures if you guys still wish to take a look at it.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 994
Re: Slow boot
« Reply #6 on: August 04, 2020, 06:33:52 AM »
That gave plenty of info.  I don't do alot of testing with copy2fs.  Is there a reason you really need copy2fs?  Its an easy way to chop 28 seconds out :)

Are you using zram or zswap?

After system boot, run 'free' how much memory is being used?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10812
Re: Slow boot
« Reply #7 on: August 04, 2020, 06:44:19 AM »
Hi ashfame
... I don't have networking enabled so I can't export the log file easily. But I will click pictures if you guys still wish to take a look at it.
Not necessary. You did exactly what I would have done. You looked through the file and determined the delay is due to lots of activity
and not a few slow commands.

Picture files are larger than  .txt  files and provide less information. They also are not search-able.

Offline ashfame

  • Full Member
  • ***
  • Posts: 112
Re: Slow boot
« Reply #8 on: August 04, 2020, 07:31:24 AM »
That gave plenty of info.  I don't do alot of testing with copy2fs.  Is there a reason you really need copy2fs?  Its an easy way to chop 28 seconds out :)

Are you using zram or zswap?

After system boot, run 'free' how much memory is being used?

Yeah, I need the bootable media to be ejectable upon boot as a characteristic of the architecture. swap is completely disabled, both modes. About 550M of RAM is used up by filesystem once its running.


Hi ashfame
... I don't have networking enabled so I can't export the log file easily. But I will click pictures if you guys still wish to take a look at it.
Not necessary. You did exactly what I would have done. You looked through the file and determined the delay is due to lots of activity
and not a few slow commands.

Picture files are larger than  .txt  files and provide less information. They also are not search-able.

Hi Rich, cool, just wanted to be sure :)

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 994
Re: Slow boot
« Reply #9 on: August 04, 2020, 07:35:49 AM »
We are testing a new tce-bootload to run mounting processes in parallel.  I'll do some testing with copy2fs.

Offline themagicm

  • Newbie
  • *
  • Posts: 8
Re: Slow boot
« Reply #10 on: August 04, 2020, 07:43:33 AM »
I was playing around with it late last night.  I removed everything but TC from onboot.lst.  Not sure if its any quicker.

Ok, whats the end game?  I'm basically trying to see how quick I can load a piece of software that requires a GUI + java that way I can use this on a PiDash in my car.  Want something that boots quick.  Currently DietPi boots up fully functional in 27-28 sec.  Just experimenting with tinycore.

Offline ashfame

  • Full Member
  • ***
  • Posts: 112
Re: Slow boot
« Reply #11 on: August 04, 2020, 07:51:39 AM »
We are testing a new tce-bootload to run mounting processes in parallel.  I'll do some testing with copy2fs.

That would be great! how do I ensure I don't miss out on the updates regarding this?

Offline mocore

  • Sr. Member
  • ****
  • Posts: 435
  • ~.~
Re: Slow boot
« Reply #12 on: August 05, 2020, 03:16:19 AM »
We are testing a new tce-bootload to run mounting processes in parallel.  I'll do some testing with copy2fs.

what method(s) are used to `run mounting processes in parallel` ??

the description reminded me of this tce-load.patch @ https://github.com/tatsushid/docker-tinycore/blob/master/11.0/x86_64/src/tce-load.patch

which uses unsquashfs .

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 994
Re: Slow boot
« Reply #13 on: August 05, 2020, 03:43:15 AM »
tce-bootload is a micropython script,  the technique is just using os.fork to create child processes.  Only creating extra processes equal to the number of processors.