New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boot time (as reported by systemd-analyze) charges systemd startup time to the kernel #17175
Comments
we take the timestamps that measure this very early in Maybe the clock source change you are seeing in the logs is fucking up timing? Otherwise not sure where the discrepancy might come from. I mean, in the time between the kernel's PID 1 execution and us getting control in main() there's just the ELF interpretor running really, that can't take 3s though? Or maybe some stupid lib is using gcc constructors to do some nonsensical crypto validation before we even start? I know that on rhel there was some nonsense like that in place once upon a time? Basically, we issue clock_gettime() with CLOCK_MONOTONIC really early on, under the assumption it started at zero when the kernel initialized. Maybe that assumption is wrong on your system? |
is this a system with an initrd? maybe the initrd spends that time on something and doesn#t mention tht in dmesg? /cc @mbiebl, given this is debian? |
@poettering Dynamically linking systemd requires loading various libraries that are being read for the first time, which means many reads that need to go all the way to the disk. Many cloud VMs have throttled disk I/O. In addition, some cloud systems when booting for the first time need to dynamically initialize their disk from a snapshot image, which happens on demand as pieces of the disk get loaded. As a simple way to reproduce, try booting a disk image that uses systemd in qemu, with I can confirm, based on watching the console, that the timestamps in the log appear to accurately reflect when they were printed. How about this: grab the current timestamp at the start of main as you currently do, but also, once (I can also think of several ways to reduce that time, but measuring it is the first step.) |
systemd version the issue has been seen with
Used distribution
The boot time statistics, as reported by systemd-analyze, treat the time that systemd is up-and-running as the time where the kernel is done booting. However, this can vary substantially, if systemd takes a while to initialize, such as if reading it and its dependencies from disk takes time. For instance:
In this case, the kernel booted in 60ms and started running
/sbin/init
. Butsystemd-analyze
reports:The time shown as "kernel" here is primarily counting the time taken for systemd to load.
The text was updated successfully, but these errors were encountered: