miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

What do these services do?

Mon Jul 22, 2019 12:34 am

I'm trying to improve boot time, running systemd-analyze blame I get:
so what do these services do?
moreover I don't want to overclock the Pi but I read that dtparam=sd_overclock=100 allows to use the full speed of UHS cards, so I can do it safely with my SanDisk Ultra or it would compromise its life?

Code: Select all

pi@raspberrypi:~ $ systemd-analyze blame
          6.364s dev-mmcblk0p2.device
          4.818s networking.service
          2.732s busybox-syslogd.service
          2.510s raspi-config.service
          1.853s systemd-udev-trigger.service
          1.767s rng-tools.service
          1.620s wifi-country.service
          1.576s ssh.service
          1.425s systemd-rfkill.service
          1.373s wpa_supplicant.service
          1.347s systemd-logind.service
          1.326s dhcpcd.service
          1.231s systemd-journald.service
          1.105s home-pi-timelapse.mount
          1.051s systemd-udevd.service
           966ms systemd-remount-fs.service
           902ms user@1000.service
           756ms systemd-random-seed.service
           714ms sys-kernel-debug.mount
           675ms systemd-tmpfiles-setup.service
           675ms dev-mqueue.mount
           637ms systemd-modules-load.service
           596ms kmod-static-nodes.service
           525ms rc-local.service
           486ms systemd-tmpfiles-setup-dev.service
           473ms plymouth-read-write.service
           436ms console-setup.service
           429ms plymouth-quit-wait.service
           426ms var-log.mount
           406ms systemd-fsck-root.service
           397ms systemd-update-utmp.service
           384ms nfs-config.service
           369ms run-rpc_pipefs.mount
           351ms tmp.mount
           332ms systemd-journal-flush.service
           318ms sys-kernel-config.mount
           307ms plymouth-quit.service
           290ms systemd-update-utmp-runlevel.service
           275ms systemd-user-sessions.service
           272ms ntp.service
           272ms var-tmp.mount
           271ms systemd-sysctl.service
           229ms plymouth-start.service
           215ms sys-fs-fuse-connections.mount
           185ms boot.mount
           149ms systemd-fsck@dev-disk-by\x2dpartuuid-4f7a30f8\x2d01.service
           124ms busybox-klogd.service

kflmiami420
Posts: 61
Joined: Thu Mar 21, 2019 6:54 pm

Re: What do these services do?

Mon Jul 22, 2019 7:11 pm

Can you find out for us ? erase them one by one and tell us what happens to your system. , LOL

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Mon Jul 22, 2019 8:54 pm

kflmiami420 wrote:
Mon Jul 22, 2019 7:11 pm
Can you find out for us ? erase them one by one and tell us what happens to your system. , LOL
I'm asking it to you

Paul Hutch
Posts: 390
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: What do these services do?

Tue Jul 23, 2019 2:30 pm

Those are all the default services that make a Raspberry Pi running Raspbian work and provide all the normal features.

You can get details of each one by doing an internet search on the service name surrounded by quotation marks to get exact matches

e.g. "networking.service" gives me: https://www.google.com/search?&q=%22net ... service%22

Raspbian is based on Debian and Ubuntu is also based on Debian. When choosing results that I hope will be helpful, my order of preference by Linux distro is:
  1. Raspbian
  2. Debian
  3. Ubuntu

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Tue Jul 23, 2019 8:57 pm

Paul Hutch wrote:
Tue Jul 23, 2019 2:30 pm
Those are all the default services that make a Raspberry Pi running Raspbian work and provide all the normal features.

You can get details of each one by doing an internet search on the service name surrounded by quotation marks to get exact matches

e.g. "networking.service" gives me: https://www.google.com/search?&q=%22net ... service%22

Raspbian is based on Debian and Ubuntu is also based on Debian. When choosing results that I hope will be helpful, my order of preference by Linux distro is:
  1. Raspbian
  2. Debian
  3. Ubuntu
I searched the 10 slowest:
dev-mmcblk0p2.device: SD filesystem check
networking.service: network?
busybox-syslogd.service: syslog?
raspi-config.service: gui for settings?
systemd-udev-trigger.service: essential operating system service?
rng-tools.service: random number generation in kernel
wifi-country.service: disables Wi-Fi if the country is not set
ssh.service: ssh
systemd-rfkill.service: generic interface for disabling any radio transmitter in the system
wpa_supplicant.service: Wi-Fi security protocol

since I'm working on a Zero (without WIFI) I could disable:
networking.service
busybox-syslogd.service
wifi-country.service
ssh.service
systemd-rfkill.service
wpa_supplicant.service

remain:

Code: Select all

dev-mmcblk0p2.device
do I need it if my SD card is read-only?

Code: Select all

raspi-config.service
in production I won't need it

Code: Select all

systemd-udev-trigger.service
I don't know what this do

Code: Select all

rng-tools.service
do I need it if I won't generate random numbers

also without network I won't need:

Code: Select all

dhcpcd.service
ntp.service
nfs-config.service
some other?

in production I won't need log too so can I disable var-log.mount and busybox-klogd.service?

tell me if I said something wrong

epoch1970
Posts: 3713
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: What do these services do?

Tue Jul 23, 2019 9:15 pm

You will need logs. Keep the busybox logging services (and the /var/log mount)

Random number generation is used in various applications, notably when encrypting data (includes wifi security). Linux by default uses mouse movements, keyboard typing etc to feed random number generation. Rngd helps noticeably when the machine lacks these interfaces

Udev, don't remove it or systemd will not be happy. And you basically won't be able to plug any device (USB etc.) in the Pi and have them configured properly. You can live without udev/eudev but then you need to populate the /dev/ directory manually and load drivers from a config file. You'd do that only on very small embedded platforms (much smaller than a Pi).

If you remove all the services you listed, you're going to accelerate the boot process (hopefully), but the machine is not going to look anything like the one in your first post...
If you're looking for a minimum system, you could build an OS using Yocto or Buildroot. These can be as minimal as you want, and boot even faster because they don't have to pull the almighty systemd.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Tue Jul 23, 2019 9:29 pm

I'll search for faster OS but at the moment I have no time to learn another one so I'm just trying to disable all services I don't need.
I'll use the Zero only to capture images to a USB stick, so why do I need logging in production? without network I could disable all network services

epoch1970
Posts: 3713
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: What do these services do?

Tue Jul 23, 2019 9:56 pm

In case your device is totally bug-free and never encounters an issue, you don't need logs. Otherwise, it is useful.
If you don't need networking, remove it, sure.

Check the system still boots... You're hacking big/important chunks out of it.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Tue Jul 23, 2019 10:17 pm

yes I'm just running a python script that capture images on a USB stick
is there any other service I could disable?

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Thu Jul 25, 2019 8:54 am

anyone can answer about sd_overclock?

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

Re: What do these services do?

Thu Jul 25, 2019 9:10 am

miky94 wrote:
Thu Jul 25, 2019 8:54 am
anyone can answer about sd_overclock?
Not used on the Pi4. On earlier models it's hack to improve SD card speed. Should not affect lifetimes.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Thu Jul 25, 2019 9:32 am

Thank you so in this case, unlike CPU overclocking which I guess is already at the maximum safe frequency, I can just set the MHz certified by the manufacturer?
I have a SanDisk Ultra UHS-I, from wikipedia:
UHS-I
Specified in SD version 3.01.[72] Supports a clock frequency of 100 MHz (a quadrupling of the original "Default Speed"), which in four-bit transfer mode could transfer 50 MB/s (SDR50). UHS-I cards declared as UHS104 (SDR104) also support a clock frequency of 208 MHz, which could transfer 104 MB/s. Double data rate operation at 50 MHz (DDR50) is also specified in Version 3.01, and is mandatory for microSDHC and microSDXC cards labeled as UHS-I. In this mode, four bits are transferred when the clock signal rises and another four bits when it falls, transferring an entire byte on each full clock cycle, hence a 50 MB/s operation could be transferred using a 50 MHz clock.
so can I set dtparam=sd_overclock=208 ? or are there any contraindications?

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

Re: What do these services do?

Thu Jul 25, 2019 10:12 am

miky94 wrote:
Thu Jul 25, 2019 9:32 am
Thank you so in this case, unlike CPU overclocking which I guess is already at the maximum safe frequency, I can just set the MHz certified by the manufacturer?
I have a SanDisk Ultra UHS-I, from wikipedia:
UHS-I
Specified in SD version 3.01.[72] Supports a clock frequency of 100 MHz (a quadrupling of the original "Default Speed"), which in four-bit transfer mode could transfer 50 MB/s (SDR50). UHS-I cards declared as UHS104 (SDR104) also support a clock frequency of 208 MHz, which could transfer 104 MB/s. Double data rate operation at 50 MHz (DDR50) is also specified in Version 3.01, and is mandatory for microSDHC and microSDXC cards labeled as UHS-I. In this mode, four bits are transferred when the clock signal rises and another four bits when it falls, transferring an entire byte on each full clock cycle, hence a 50 MB/s operation could be transferred using a 50 MHz clock.
so can I set dtparam=sd_overclock=208 ? or are there any contraindications?
Start at 100, see if that works.
Then increase but it is in steps and probably not worth it.
You may need to drop to 83 (the next step under 100 iirc).

Do a search, look at retropie they had a small part on it.

It does increase speeds, but do you need it?

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Thu Jul 25, 2019 10:19 am

bensimmo wrote:
Thu Jul 25, 2019 10:12 am
Start at 100, see if that works.
Then increase but it is in steps and probably not worth it.
You may need to drop to 83 (the next step under 100 iirc).

Do a search, look at retropie they had a small part on it.

It does increase speeds, but do you need it?
which are these steps, 50,83,100,...?
an higher speed is always better, if there are no cons so, why not?

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

Re: What do these services do?

Thu Jul 25, 2019 3:14 pm

miky94 wrote:
Thu Jul 25, 2019 10:19 am
bensimmo wrote:
Thu Jul 25, 2019 10:12 am
Start at 100, see if that works.
Then increase but it is in steps and probably not worth it.
You may need to drop to 83 (the next step under 100 iirc).

Do a search, look at retropie they had a small part on it.

It does increase speeds, but do you need it?
which are these steps, 50,83,100,...?
an higher speed is always better, if there are no cons so, why not?
The cons are, it may not run, I'm not sure which cards some people, you may not see corruption until well you see it. I don't think anyone got that much higher than 100.
The steps, I can't remember but it is some multiple of some bus.
But if you type 100 and it takes the value (you'll need to check) it'll be 100, if you use 99 and it takes the value, it'll be 83.
It's always the next lowest step no matter what the number is.
If you see what I mean.
But try it, see what works and doesn't work for you.
If it doesn't start, edit it on on something else. It's just a fat partition and text file.

Faster usually means more heat and more electricity usage. if you don't need the speed, run it cooler.
(I have no values for either).

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Thu Jul 25, 2019 4:05 pm

bensimmo wrote:
Thu Jul 25, 2019 3:14 pm
The cons are, it may not run, I'm not sure which cards some people, you may not see corruption until well you see it. I don't think anyone got that much higher than 100.
The steps, I can't remember but it is some multiple of some bus.
But if you type 100 and it takes the value (you'll need to check) it'll be 100, if you use 99 and it takes the value, it'll be 83.
It's always the next lowest step no matter what the number is.
If you see what I mean.
But try it, see what works and doesn't work for you.
If it doesn't start, edit it on on something else. It's just a fat partition and text file.

Faster usually means more heat and more electricity usage. if you don't need the speed, run it cooler.
(I have no values for either).
I'll probably try 100, the double of the default value I think is enough, anyway faster means also finish earlier so more "resting" time
since I'm using the Pi in an outdoors, static (read-only SD) and of prolonged use project, I think that could fast the boot and once the program is in the RAM, I should not have overheating problems right?

miky94
Posts: 105
Joined: Sun Jun 03, 2018 9:17 pm

Re: What do these services do?

Tue Jul 30, 2019 8:07 pm

here are my services still enabled:

Code: Select all

dev-mmcblk0p2.device
networking.service
ssh.service
systemd-logind.service
systemd-udev-trigger.service
systemd-udevd.service
wpa_supplicant.service
dhcpcd.service
systemd-remount-fs.service
plymouth-start.service
user@1000.service
systemd-journald.service
rc-local.service
systemd-tmpfiles-setup-dev.service
systemd-tmpfiles-setup.service
sys-kernel-debug.mount
systemd-update-utmp.service
dev-mqueue.mount
boot.mount
systemd-journal-flush.service
tmp.mount
sys-kernel-config.mount
run-rpc_pipefs.mount
systemd-update-utmp-runlevel.service
systemd-modules-load.service
systemd-rfkill.service
systemd-sysctl.service
systemd-fsck-root.service
var-tmp.mount
plymouth-quit-wait.service
console-setup.service
plymouth-quit.service
systemd-random-seed.service
kmod-static-nodes.service
systemd-user-sessions.service
var-log.mount
nfs-config.service
plymouth-read-write.service
systemd-fsck@dev-disk-by\x2dpartuuid-4f7a30f8\x2d01.service
sys-fs-fuse-connections.mount
I also wrote this script to disable network services:

Code: Select all

disable-network.sh
sudo systemctl disable dhcpcd.service
sudo systemctl disable networking.service
sudo systemctl disable ssh.service
sudo systemctl disable systemd-rfkill.service
sudo systemctl disable wpa_supplicant.service
I tried to disable unsuccessfully var-log.mount and nfs-config.service, if I run is-enabled I get respectively generated and static, but they are among the fastest

do you know the purpose of any other service I could disable?

dtparam=sd_overclock=100 decreases boot time of about 0.5s on a Raspberry SD (don't know maker and datasheet)

do you think that on a read-only SD and running only a python script sd_overclock overheating could be a problem?

Return to “General discussion”