My systemd-analyze plot output
I've been playing with various systemd services and adjusting them to minimize bootup time. My biggest time waster was NetworkManager-wait-online.services. It was taking 28 seconds. I set it to wait a random amount of time between 15 and 30 minutes after the desktop displayed before it would run. My next most problematic service is my USB Printer connection, which takes 7.1 seconds. Below are the outputs of the plot. They show
When my laptop starts up there is a pause of about 4-6 seconds and then a beep. Is that the grub beep? Then there is a pause of about 15-20 seconds and I get the login prompt. After entering my password the desktop shows almost immediately. But, actually, by my wrist watch, my power on to working desktop is about 25-30 seconds. Most of it between the beep and the appearance of tthe login prompt. I can't explain what those systemd-analyze numbers mean. If I were to guess I'd say that from power on to the beep is the POST period, which Systemd cannot time. Timing starts when Grub fires the kernel. Is the beep due to grub? As I wrote, my longest stretch is between the beep and the login prompt. I've timed from the press of the power button to the login prompt at 31 seconds.
As you can see in the second graph, my biggest delay is the usb printer connection service. IF I found a way to move that service till some time after my desktop appears and is functional, then my power-on to working desktop would be about 7 seconds.
Over Provisioning an SSD
Note: The BEST time to set up OP is when you are in the format phase of a new install. Decide how much the OP space should be and subtract that from the size of the RAW partition. Format the raw space at the front of the drive. Leave the unformatted raw space for the controller to untilize as an Over Provisioning area.
Another thing I've been looking into in order to speed things up is to increase the over provisioning of my SSD from the factory default of 9% to about 20-30%, WITHOUT having to reinstall Kubuntu Bionic. My first task would be to shrink my BTRFS <ROOT_FS> volume by about 10-20%. Then, resize that partition to be just above that shrunken volume. Make snapshots and back them up. Then, expand the <ROOT_FS> into the partition to fill it up. After I'd need to do a secure erase of that freed up raw space using hdparm. Unfortunately, the hdparm secure erase command is:
hdparm --user-master u --security-erase PASSWD /dev/sdb security_password="PASSWD"
which doesn't allow setting sector starting (or ending) parameters, that I can find.
From what I've read, over provisioning can speed up an SSD by up to a factor of 4, for an OP of around 30%.
If I could just double my SSD speed my boot up would be 5 or 6 seconds.
https://www.thomas-krenn.com/en/wiki/SSD_Secure_Erase
A method of OP'ing using fdisk is shown here, but using KPartitionManager isn't any different and is a lot easier because it is visual.
https://www.tech-g.com/2015/06/13/ov...-ssd-in-linux/
To see if using only the 9% factor OP was sufficient I checked the LBA on my SSD.
Putting that "Total LBAs Written" value into the calculator at
https://www.virten.net/2016/12/ssd-t...en-calculator/
I get a value of 2.05 TBW (TerraBytesWritten). My SSD has a TBW life of 300 TWB.
That TBW of 2.05 is for 1,061 hours of total use. Dividing 300 by 2.05 yields 146.
1,061 hrs * 146 / 24/365 = 17 years. My warranty is good for 10 years, IIRC.
So, I may not need to increase my OP. Probably won't. (IF it ain't broke don't fix it!)
I've been playing with various systemd services and adjusting them to minimize bootup time. My biggest time waster was NetworkManager-wait-online.services. It was taking 28 seconds. I set it to wait a random amount of time between 15 and 30 minutes after the desktop displayed before it would run. My next most problematic service is my USB Printer connection, which takes 7.1 seconds. Below are the outputs of the plot. They show
Startup finished in 3.774s (kernel) + 8.433s (userspace) = 12.207s
graphical.target reached after 2.025s in userspace
graphical.target reached after 2.025s in userspace
As you can see in the second graph, my biggest delay is the usb printer connection service. IF I found a way to move that service till some time after my desktop appears and is functional, then my power-on to working desktop would be about 7 seconds.
Over Provisioning an SSD
Note: The BEST time to set up OP is when you are in the format phase of a new install. Decide how much the OP space should be and subtract that from the size of the RAW partition. Format the raw space at the front of the drive. Leave the unformatted raw space for the controller to untilize as an Over Provisioning area.
Another thing I've been looking into in order to speed things up is to increase the over provisioning of my SSD from the factory default of 9% to about 20-30%, WITHOUT having to reinstall Kubuntu Bionic. My first task would be to shrink my BTRFS <ROOT_FS> volume by about 10-20%. Then, resize that partition to be just above that shrunken volume. Make snapshots and back them up. Then, expand the <ROOT_FS> into the partition to fill it up. After I'd need to do a secure erase of that freed up raw space using hdparm. Unfortunately, the hdparm secure erase command is:
hdparm --user-master u --security-erase PASSWD /dev/sdb security_password="PASSWD"
which doesn't allow setting sector starting (or ending) parameters, that I can find.
From what I've read, over provisioning can speed up an SSD by up to a factor of 4, for an OP of around 30%.
If I could just double my SSD speed my boot up would be 5 or 6 seconds.
https://www.thomas-krenn.com/en/wiki/SSD_Secure_Erase
A method of OP'ing using fdisk is shown here, but using KPartitionManager isn't any different and is a lot easier because it is visual.
https://www.tech-g.com/2015/06/13/ov...-ssd-in-linux/
To see if using only the 9% factor OP was sufficient I checked the LBA on my SSD.
"Total LBAs Written","never","99","99","0","4,409,274,097","old age","-O--CK"
https://www.virten.net/2016/12/ssd-t...en-calculator/
I get a value of 2.05 TBW (TerraBytesWritten). My SSD has a TBW life of 300 TWB.
That TBW of 2.05 is for 1,061 hours of total use. Dividing 300 by 2.05 yields 146.
1,061 hrs * 146 / 24/365 = 17 years. My warranty is good for 10 years, IIRC.
So, I may not need to increase my OP. Probably won't. (IF it ain't broke don't fix it!)
Comment