You are not logged in.
Hello!
I have standard Arch installation. Recently, I checked the start-up process with systemd-analyze blame and found that systemd-random-seed.service is at the top with 1.4 seconds winning with the 2nd place service whole second. Status of this systemd service has some "Kernel entropy pool is not initialized yet, waiting until it is." witch I can't interpret. But I can compare how other Arch-based systems perform on my PC, and they have random-seed to spend less than 100 ms during the boot. This made me anxious to find out why and how to reproduce this speed in my main pure Arch system. Unfortunately, I couldn't find some helpful information in the ArchWiki. To the info, I have a lot of entropy (but not the RDRAND, because I have old CPU, FX-6300):
cat /proc/sys/kernel/random/entropy_avail
3820
After spending some time in digging in, I found that probable main difference between my system and other Arch-based distros is Calamares installer. And voilà, it code has some tuning for random and entropy. But it is hardcoded in C, and I don't get how it manipulates with the system. What I find, is that at the end I have only /var/lib/systemd/random-seed and calamares-installed systems have also /var/lib/urandom/random-seed. And the result is fantastic.
So, I ask for help. How can I better my system and not to see this 1.4 seconds in blame's list?
Offline
Offline
Thank you for fast reply. I found that wiki page and it contains very little information for how to improve the pure performance I have. Plus, it has the disclaimer "This article or section is out of date." which encouraged me to post the question here.
Offline
How relevant are these seconds in the grand scheme of things? What's your
systemd-analyze critical-chain? Is this reproducible? Afaik it will take a while the first time and then the point of it is that it will load it from disk eventually. Also which boot-loader? Afaik systemd-boot is the only one that can make "proper" use of this early on, so if you using something else and these installers use systemd-boot then this might be the early delay you're seeing.
Offline
critical-chain is somewhat weird. Also in graphical mode (systemd-analyze plot > plot.svg) - https://postimg.cc/sBD7rRNG :
graphical.target @2.401s
└─lightdm.service @2.160s +240ms
└─systemd-user-sessions.service @2.154s +4ms
└─nss-user-lookup.target @2.188s
1. Yes, it is reproducible. I get this long time for the random-seed service every boot.
2. I use GRUB and then lightDM with autologin.
Offline
run the critical chain command as root, since this appears to be user session only.
2. This could be the problem, did you also use grub for the "Arch-based" distro experiments?
Offline
Strange, but It's the output with root privileges (simply with sudo and inside sudo -s).
2. Yes, I tried Arco-linux and EndeavourOS. Both of them use grub.
Offline
That said this is really quick especially in the loader, do the other systems really significantly lower from the 5 seconds? This sounds to me like they probably loose time elsewhere that you then just don't visibly see as entropy could be gathered before being relevant for the random-seed.service. FWIW technically the random-seed service isn't critical, so you could also just disable it. But I'm assuming you are chasing something that doesn't have an actual real effect in the end.
Offline
But I can compare how other Arch-based systems perform on my PC, and they have random-seed to spend less than 100 ms during the boot.
Post full system journals for both systems?
Calamares installer. And voilà, it code has some tuning for random and entropy. But it is hardcoded in C, and I don't get how it manipulates with the system.
Maybe reference the codepoint you suspect to be relevant?
Online
Oh, I'm not chasing anything. Just curious why there is such big difference. Also it's intriguing what is this "tuning" made by Calamares (for instance, I don't see a message "Kernel entropy pool is not initialized yet, waiting until it is." in the status of systemd-random-seed.service there). What I'm afraid of is that my old CPU would need some tuning (maybe Calamare's one) because new versions of kernel have in focus modern CPUs with their RDRAND capability. So I see /var/lib/urandom/random-seed anymore as example.
Offline
Post full system journals for both systems?
My actual system — http://ix.io/3J9F
Arco-linux on my PC — http://ix.io/3J9H
Maybe reference the codepoint you suspect to be relevant?
I'm speaking about this config inside Calamares https://github.com/calamares/calamares/ … ineid.conf and its execution by Entropy.cpp and MachineIdJob.cpp
Offline
What if you compare two VM based installs rather than bare metal vs VM? Virtual machines have more issues with entropy due to lack hardware available to extract any entropy from.
Offline
If copies the entropy pool from a host, but that looks installation specific (target root)
But is the calamaris system a virtual machine?
(You're starting one on arch and the calamaris hostname looks suspicious and you're loading virtio_blk…)
Edit: curses at the lack of F5
Last edited by seth (2021-12-22 20:11:52)
Online
If the system supports EFI then you could use systemd-boot to seed the kernel RNG early.
Offline
What if you compare two VM based installs rather than bare metal vs VM? Virtual machines have more issues with entropy due to lack hardware available to extract any entropy from.
I just don't have now second drive to try calamares-installed Arch-based OS on my machine. But I tested it few weeks ago and similar time as I have today in VM (less than 100 ms). I'll try simple Arch install in the VM tomorrow and post the result here.
Edit: curses at the lack of F5
Excuse me, I don't understand this part "curses at the lack of F5"?
If the system supports EFI then you could use systemd-boot to seed the kernel RNG early.
As I can notice, the majority of distributions uses Grub and Arch recommends it so I'd rather won't change well-supported piece of software. But ad experimentum would try and see if there's some difference.
Offline
Excuse me, I don't understand this part "curses at the lack of F5"?
I opened this thread, started to look at you journals, started to write a response, looked at the calamares source, added that segment and pushed the "submit" button. Meanwhile loqs had sneaked in and already pointed out the VM situation.
Had I pressed F5 before posting, I'd have seen that.
I'll try simple Arch install in the VM tomorrow and post the result here.
calamares on bare metal would probably be more interesting…
What's
cat /sys/devices/virtual/misc/hw_random/rng_currenton the virtual system?
Online
Well, now I understand problem with my data. QEMU gives random beforehand, so VM has it plentiful and seeds start quickly.
And:
cat /sys/devices/virtual/misc/hw_random/rng_current gives virtio_rng.0
Offline