25s between systemd startup and actual display

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am trying to reduce startup time of a Beaglebone (4.14.32-ti-r42 #1 SMP Thu Apr 5 23:13:09 UTC 2018 armv7l GNU/Linux) running Debian Stretch to display a local HTML page on its LCD.



Every analysis I've done so far indicates startup is <25s, but it still takes over 45s to display the HTML page.



systemd-analyze
Startup finished in 6.158s (kernel) + 17.082s (userspace) = 23.240s

systemd-analyze blame
22.762s dev-mmcblk1p1.device
12.823s postgresql@9.6-main.service
2.613s systemd-udev-trigger.service
2.301s systemd-logind.service
1.874s sysstat.service
1.848s networking.service
1.431s bb-wl18xx-wlan0.service
1.430s ssh.service
1.186s generic-board-startup.service
1.082s connman.service
891ms avahi-daemon.service
859ms systemd-journald.service
798ms udhcpd.service
639ms systemd-udevd.service
491ms systemd-timesyncd.service
464ms systemd-random-seed.service
449ms systemd-tmpfiles-setup-dev.service
415ms systemd-user-sessions.service
363ms rsyslog.service
310ms systemd-sysctl.service
304ms sys-fs-fuse-connections.mount
302ms systemd-update-utmp-runlevel.service
302ms systemd-tmpfiles-setup.service
269ms sys-kernel-debug.mount
269ms hostapd.service
252ms sys-kernel-config.mount
249ms systemd-modules-load.service
230ms systemd-backlight@backlight:backlight.service
221ms systemd-journal-flush.service
215ms dev-mqueue.mount
205ms kmod-static-nodes.service
205ms systemd-update-utmp.service
199ms user@1000.service
160ms systemd-remount-fs.service
47ms postgresql.service

systemd-analyze critical-chain
graphical.target @14.388s
└─multi-user.target @14.383s
└─postgresql.service @14.326s +30ms
└─postgresql@9.6-main.service @3.885s +10.382s
└─basic.target @3.639s
└─sockets.target @3.639s
└─dbus.socket @3.639s
└─sysinit.target @3.635s
└─systemd-backlight@backlight:backlight.service @12.982s +205ms
└─system-systemdx2dbacklight.slice @12.943s
└─system.slice @700ms
└─-.slice @614ms


The HTML page service



The process I created that loads the page on the LCD is at-gui.service:



[Unit]
Description=Start GUI

[Service]
ExecStart=/bin/bash -lc 'startx'

[Install]
WantedBy=basic.target


This process starts OpenBox, which is configured to load a browser with the HTML page shown.



Startup Times



The LCD shows some change in brightness (potentially indicating Openbox has started?) around 27s after startup. It takes 48s to show the HTML page.



A possible start



  • The item postgresql@9.6-main.service takes >10s to start. I need it (I need access to a Postgres database), but not before showing that first page. Is there a leaner equivalent of postgresql@9.6-main.service just for running a Postgres database?

Main question



  • How can one see where the extra ~25s is going?

  • How can one front-load the display of an HTML page?






share|improve this question



















  • If the only thing you're doing is displaying an HTML page, is there a reason you need this to sit on top of an X server? Would netsurf fill your needs?
    – DopeGhoti
    Jun 6 at 17:14










  • I'm not sure - the first page is just a loader. Eventually, we're running Rails, which accesses a Postgres database (Rails finishes last after ~75s). All local, no networking.
    – sscirrus
    Jun 6 at 17:19











  • We're building a sort of kiosk, so we needed the browser to be 'locked' from the user's perspective. We define our own super-simple webkit browser using Gtk and have it load the page.
    – sscirrus
    Jun 6 at 17:22






  • 1




    Seems fairly good the time.
    – Rui F Ribeiro
    Jun 6 at 21:46










  • I agree with user Rui F Ribeiro, if it takes roughly a minute from start up to your html display screen I do not see what the issue is. Please clarify why waiting a minute from a cold boot to static html page is an issue. Possible solutions would be to create cronjobs on start up that will get the services running or to not power down the computer between use or to use a non-systemd system.
    – kemotep
    Jun 7 at 13:01















up vote
0
down vote

favorite












I am trying to reduce startup time of a Beaglebone (4.14.32-ti-r42 #1 SMP Thu Apr 5 23:13:09 UTC 2018 armv7l GNU/Linux) running Debian Stretch to display a local HTML page on its LCD.



Every analysis I've done so far indicates startup is <25s, but it still takes over 45s to display the HTML page.



systemd-analyze
Startup finished in 6.158s (kernel) + 17.082s (userspace) = 23.240s

systemd-analyze blame
22.762s dev-mmcblk1p1.device
12.823s postgresql@9.6-main.service
2.613s systemd-udev-trigger.service
2.301s systemd-logind.service
1.874s sysstat.service
1.848s networking.service
1.431s bb-wl18xx-wlan0.service
1.430s ssh.service
1.186s generic-board-startup.service
1.082s connman.service
891ms avahi-daemon.service
859ms systemd-journald.service
798ms udhcpd.service
639ms systemd-udevd.service
491ms systemd-timesyncd.service
464ms systemd-random-seed.service
449ms systemd-tmpfiles-setup-dev.service
415ms systemd-user-sessions.service
363ms rsyslog.service
310ms systemd-sysctl.service
304ms sys-fs-fuse-connections.mount
302ms systemd-update-utmp-runlevel.service
302ms systemd-tmpfiles-setup.service
269ms sys-kernel-debug.mount
269ms hostapd.service
252ms sys-kernel-config.mount
249ms systemd-modules-load.service
230ms systemd-backlight@backlight:backlight.service
221ms systemd-journal-flush.service
215ms dev-mqueue.mount
205ms kmod-static-nodes.service
205ms systemd-update-utmp.service
199ms user@1000.service
160ms systemd-remount-fs.service
47ms postgresql.service

systemd-analyze critical-chain
graphical.target @14.388s
└─multi-user.target @14.383s
└─postgresql.service @14.326s +30ms
└─postgresql@9.6-main.service @3.885s +10.382s
└─basic.target @3.639s
└─sockets.target @3.639s
└─dbus.socket @3.639s
└─sysinit.target @3.635s
└─systemd-backlight@backlight:backlight.service @12.982s +205ms
└─system-systemdx2dbacklight.slice @12.943s
└─system.slice @700ms
└─-.slice @614ms


The HTML page service



The process I created that loads the page on the LCD is at-gui.service:



[Unit]
Description=Start GUI

[Service]
ExecStart=/bin/bash -lc 'startx'

[Install]
WantedBy=basic.target


This process starts OpenBox, which is configured to load a browser with the HTML page shown.



Startup Times



The LCD shows some change in brightness (potentially indicating Openbox has started?) around 27s after startup. It takes 48s to show the HTML page.



A possible start



  • The item postgresql@9.6-main.service takes >10s to start. I need it (I need access to a Postgres database), but not before showing that first page. Is there a leaner equivalent of postgresql@9.6-main.service just for running a Postgres database?

Main question



  • How can one see where the extra ~25s is going?

  • How can one front-load the display of an HTML page?






share|improve this question



















  • If the only thing you're doing is displaying an HTML page, is there a reason you need this to sit on top of an X server? Would netsurf fill your needs?
    – DopeGhoti
    Jun 6 at 17:14










  • I'm not sure - the first page is just a loader. Eventually, we're running Rails, which accesses a Postgres database (Rails finishes last after ~75s). All local, no networking.
    – sscirrus
    Jun 6 at 17:19











  • We're building a sort of kiosk, so we needed the browser to be 'locked' from the user's perspective. We define our own super-simple webkit browser using Gtk and have it load the page.
    – sscirrus
    Jun 6 at 17:22






  • 1




    Seems fairly good the time.
    – Rui F Ribeiro
    Jun 6 at 21:46










  • I agree with user Rui F Ribeiro, if it takes roughly a minute from start up to your html display screen I do not see what the issue is. Please clarify why waiting a minute from a cold boot to static html page is an issue. Possible solutions would be to create cronjobs on start up that will get the services running or to not power down the computer between use or to use a non-systemd system.
    – kemotep
    Jun 7 at 13:01













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to reduce startup time of a Beaglebone (4.14.32-ti-r42 #1 SMP Thu Apr 5 23:13:09 UTC 2018 armv7l GNU/Linux) running Debian Stretch to display a local HTML page on its LCD.



Every analysis I've done so far indicates startup is <25s, but it still takes over 45s to display the HTML page.



systemd-analyze
Startup finished in 6.158s (kernel) + 17.082s (userspace) = 23.240s

systemd-analyze blame
22.762s dev-mmcblk1p1.device
12.823s postgresql@9.6-main.service
2.613s systemd-udev-trigger.service
2.301s systemd-logind.service
1.874s sysstat.service
1.848s networking.service
1.431s bb-wl18xx-wlan0.service
1.430s ssh.service
1.186s generic-board-startup.service
1.082s connman.service
891ms avahi-daemon.service
859ms systemd-journald.service
798ms udhcpd.service
639ms systemd-udevd.service
491ms systemd-timesyncd.service
464ms systemd-random-seed.service
449ms systemd-tmpfiles-setup-dev.service
415ms systemd-user-sessions.service
363ms rsyslog.service
310ms systemd-sysctl.service
304ms sys-fs-fuse-connections.mount
302ms systemd-update-utmp-runlevel.service
302ms systemd-tmpfiles-setup.service
269ms sys-kernel-debug.mount
269ms hostapd.service
252ms sys-kernel-config.mount
249ms systemd-modules-load.service
230ms systemd-backlight@backlight:backlight.service
221ms systemd-journal-flush.service
215ms dev-mqueue.mount
205ms kmod-static-nodes.service
205ms systemd-update-utmp.service
199ms user@1000.service
160ms systemd-remount-fs.service
47ms postgresql.service

systemd-analyze critical-chain
graphical.target @14.388s
└─multi-user.target @14.383s
└─postgresql.service @14.326s +30ms
└─postgresql@9.6-main.service @3.885s +10.382s
└─basic.target @3.639s
└─sockets.target @3.639s
└─dbus.socket @3.639s
└─sysinit.target @3.635s
└─systemd-backlight@backlight:backlight.service @12.982s +205ms
└─system-systemdx2dbacklight.slice @12.943s
└─system.slice @700ms
└─-.slice @614ms


The HTML page service



The process I created that loads the page on the LCD is at-gui.service:



[Unit]
Description=Start GUI

[Service]
ExecStart=/bin/bash -lc 'startx'

[Install]
WantedBy=basic.target


This process starts OpenBox, which is configured to load a browser with the HTML page shown.



Startup Times



The LCD shows some change in brightness (potentially indicating Openbox has started?) around 27s after startup. It takes 48s to show the HTML page.



A possible start



  • The item postgresql@9.6-main.service takes >10s to start. I need it (I need access to a Postgres database), but not before showing that first page. Is there a leaner equivalent of postgresql@9.6-main.service just for running a Postgres database?

Main question



  • How can one see where the extra ~25s is going?

  • How can one front-load the display of an HTML page?






share|improve this question











I am trying to reduce startup time of a Beaglebone (4.14.32-ti-r42 #1 SMP Thu Apr 5 23:13:09 UTC 2018 armv7l GNU/Linux) running Debian Stretch to display a local HTML page on its LCD.



Every analysis I've done so far indicates startup is <25s, but it still takes over 45s to display the HTML page.



systemd-analyze
Startup finished in 6.158s (kernel) + 17.082s (userspace) = 23.240s

systemd-analyze blame
22.762s dev-mmcblk1p1.device
12.823s postgresql@9.6-main.service
2.613s systemd-udev-trigger.service
2.301s systemd-logind.service
1.874s sysstat.service
1.848s networking.service
1.431s bb-wl18xx-wlan0.service
1.430s ssh.service
1.186s generic-board-startup.service
1.082s connman.service
891ms avahi-daemon.service
859ms systemd-journald.service
798ms udhcpd.service
639ms systemd-udevd.service
491ms systemd-timesyncd.service
464ms systemd-random-seed.service
449ms systemd-tmpfiles-setup-dev.service
415ms systemd-user-sessions.service
363ms rsyslog.service
310ms systemd-sysctl.service
304ms sys-fs-fuse-connections.mount
302ms systemd-update-utmp-runlevel.service
302ms systemd-tmpfiles-setup.service
269ms sys-kernel-debug.mount
269ms hostapd.service
252ms sys-kernel-config.mount
249ms systemd-modules-load.service
230ms systemd-backlight@backlight:backlight.service
221ms systemd-journal-flush.service
215ms dev-mqueue.mount
205ms kmod-static-nodes.service
205ms systemd-update-utmp.service
199ms user@1000.service
160ms systemd-remount-fs.service
47ms postgresql.service

systemd-analyze critical-chain
graphical.target @14.388s
└─multi-user.target @14.383s
└─postgresql.service @14.326s +30ms
└─postgresql@9.6-main.service @3.885s +10.382s
└─basic.target @3.639s
└─sockets.target @3.639s
└─dbus.socket @3.639s
└─sysinit.target @3.635s
└─systemd-backlight@backlight:backlight.service @12.982s +205ms
└─system-systemdx2dbacklight.slice @12.943s
└─system.slice @700ms
└─-.slice @614ms


The HTML page service



The process I created that loads the page on the LCD is at-gui.service:



[Unit]
Description=Start GUI

[Service]
ExecStart=/bin/bash -lc 'startx'

[Install]
WantedBy=basic.target


This process starts OpenBox, which is configured to load a browser with the HTML page shown.



Startup Times



The LCD shows some change in brightness (potentially indicating Openbox has started?) around 27s after startup. It takes 48s to show the HTML page.



A possible start



  • The item postgresql@9.6-main.service takes >10s to start. I need it (I need access to a Postgres database), but not before showing that first page. Is there a leaner equivalent of postgresql@9.6-main.service just for running a Postgres database?

Main question



  • How can one see where the extra ~25s is going?

  • How can one front-load the display of an HTML page?








share|improve this question










share|improve this question




share|improve this question









asked Jun 6 at 17:08









sscirrus

1484




1484











  • If the only thing you're doing is displaying an HTML page, is there a reason you need this to sit on top of an X server? Would netsurf fill your needs?
    – DopeGhoti
    Jun 6 at 17:14










  • I'm not sure - the first page is just a loader. Eventually, we're running Rails, which accesses a Postgres database (Rails finishes last after ~75s). All local, no networking.
    – sscirrus
    Jun 6 at 17:19











  • We're building a sort of kiosk, so we needed the browser to be 'locked' from the user's perspective. We define our own super-simple webkit browser using Gtk and have it load the page.
    – sscirrus
    Jun 6 at 17:22






  • 1




    Seems fairly good the time.
    – Rui F Ribeiro
    Jun 6 at 21:46










  • I agree with user Rui F Ribeiro, if it takes roughly a minute from start up to your html display screen I do not see what the issue is. Please clarify why waiting a minute from a cold boot to static html page is an issue. Possible solutions would be to create cronjobs on start up that will get the services running or to not power down the computer between use or to use a non-systemd system.
    – kemotep
    Jun 7 at 13:01

















  • If the only thing you're doing is displaying an HTML page, is there a reason you need this to sit on top of an X server? Would netsurf fill your needs?
    – DopeGhoti
    Jun 6 at 17:14










  • I'm not sure - the first page is just a loader. Eventually, we're running Rails, which accesses a Postgres database (Rails finishes last after ~75s). All local, no networking.
    – sscirrus
    Jun 6 at 17:19











  • We're building a sort of kiosk, so we needed the browser to be 'locked' from the user's perspective. We define our own super-simple webkit browser using Gtk and have it load the page.
    – sscirrus
    Jun 6 at 17:22






  • 1




    Seems fairly good the time.
    – Rui F Ribeiro
    Jun 6 at 21:46










  • I agree with user Rui F Ribeiro, if it takes roughly a minute from start up to your html display screen I do not see what the issue is. Please clarify why waiting a minute from a cold boot to static html page is an issue. Possible solutions would be to create cronjobs on start up that will get the services running or to not power down the computer between use or to use a non-systemd system.
    – kemotep
    Jun 7 at 13:01
















If the only thing you're doing is displaying an HTML page, is there a reason you need this to sit on top of an X server? Would netsurf fill your needs?
– DopeGhoti
Jun 6 at 17:14




If the only thing you're doing is displaying an HTML page, is there a reason you need this to sit on top of an X server? Would netsurf fill your needs?
– DopeGhoti
Jun 6 at 17:14












I'm not sure - the first page is just a loader. Eventually, we're running Rails, which accesses a Postgres database (Rails finishes last after ~75s). All local, no networking.
– sscirrus
Jun 6 at 17:19





I'm not sure - the first page is just a loader. Eventually, we're running Rails, which accesses a Postgres database (Rails finishes last after ~75s). All local, no networking.
– sscirrus
Jun 6 at 17:19













We're building a sort of kiosk, so we needed the browser to be 'locked' from the user's perspective. We define our own super-simple webkit browser using Gtk and have it load the page.
– sscirrus
Jun 6 at 17:22




We're building a sort of kiosk, so we needed the browser to be 'locked' from the user's perspective. We define our own super-simple webkit browser using Gtk and have it load the page.
– sscirrus
Jun 6 at 17:22




1




1




Seems fairly good the time.
– Rui F Ribeiro
Jun 6 at 21:46




Seems fairly good the time.
– Rui F Ribeiro
Jun 6 at 21:46












I agree with user Rui F Ribeiro, if it takes roughly a minute from start up to your html display screen I do not see what the issue is. Please clarify why waiting a minute from a cold boot to static html page is an issue. Possible solutions would be to create cronjobs on start up that will get the services running or to not power down the computer between use or to use a non-systemd system.
– kemotep
Jun 7 at 13:01





I agree with user Rui F Ribeiro, if it takes roughly a minute from start up to your html display screen I do not see what the issue is. Please clarify why waiting a minute from a cold boot to static html page is an issue. Possible solutions would be to create cronjobs on start up that will get the services running or to not power down the computer between use or to use a non-systemd system.
– kemotep
Jun 7 at 13:01











1 Answer
1






active

oldest

votes

















up vote
0
down vote













To answer your first question:



Your at-gui.service has Type=simple (the default), so it's considered started as soon as the bash process is started. Thus whatever time it actually takes for it to display something useful is not accounted for by systemd.



I don't understand your second question, and it should probably be asked separately anyway.






share|improve this answer





















  • I'll clarify my second question - I mean to ask how might I get the HTML page to load and display sooner in the process?
    – sscirrus
    Jun 7 at 23:24










  • Try replacing X11 with DirectFB or SDL. GTK 2 had DirectFB support, but it was removed in GTK 3. Or Webkit has other options besides GTK.
    – Ferenc Wágner
    Jun 10 at 18:54











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448250%2f25s-between-systemd-startup-and-actual-display%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













To answer your first question:



Your at-gui.service has Type=simple (the default), so it's considered started as soon as the bash process is started. Thus whatever time it actually takes for it to display something useful is not accounted for by systemd.



I don't understand your second question, and it should probably be asked separately anyway.






share|improve this answer





















  • I'll clarify my second question - I mean to ask how might I get the HTML page to load and display sooner in the process?
    – sscirrus
    Jun 7 at 23:24










  • Try replacing X11 with DirectFB or SDL. GTK 2 had DirectFB support, but it was removed in GTK 3. Or Webkit has other options besides GTK.
    – Ferenc Wágner
    Jun 10 at 18:54















up vote
0
down vote













To answer your first question:



Your at-gui.service has Type=simple (the default), so it's considered started as soon as the bash process is started. Thus whatever time it actually takes for it to display something useful is not accounted for by systemd.



I don't understand your second question, and it should probably be asked separately anyway.






share|improve this answer





















  • I'll clarify my second question - I mean to ask how might I get the HTML page to load and display sooner in the process?
    – sscirrus
    Jun 7 at 23:24










  • Try replacing X11 with DirectFB or SDL. GTK 2 had DirectFB support, but it was removed in GTK 3. Or Webkit has other options besides GTK.
    – Ferenc Wágner
    Jun 10 at 18:54













up vote
0
down vote










up vote
0
down vote









To answer your first question:



Your at-gui.service has Type=simple (the default), so it's considered started as soon as the bash process is started. Thus whatever time it actually takes for it to display something useful is not accounted for by systemd.



I don't understand your second question, and it should probably be asked separately anyway.






share|improve this answer













To answer your first question:



Your at-gui.service has Type=simple (the default), so it's considered started as soon as the bash process is started. Thus whatever time it actually takes for it to display something useful is not accounted for by systemd.



I don't understand your second question, and it should probably be asked separately anyway.







share|improve this answer













share|improve this answer



share|improve this answer











answered Jun 7 at 16:52









Ferenc Wágner

2,704920




2,704920











  • I'll clarify my second question - I mean to ask how might I get the HTML page to load and display sooner in the process?
    – sscirrus
    Jun 7 at 23:24










  • Try replacing X11 with DirectFB or SDL. GTK 2 had DirectFB support, but it was removed in GTK 3. Or Webkit has other options besides GTK.
    – Ferenc Wágner
    Jun 10 at 18:54

















  • I'll clarify my second question - I mean to ask how might I get the HTML page to load and display sooner in the process?
    – sscirrus
    Jun 7 at 23:24










  • Try replacing X11 with DirectFB or SDL. GTK 2 had DirectFB support, but it was removed in GTK 3. Or Webkit has other options besides GTK.
    – Ferenc Wágner
    Jun 10 at 18:54
















I'll clarify my second question - I mean to ask how might I get the HTML page to load and display sooner in the process?
– sscirrus
Jun 7 at 23:24




I'll clarify my second question - I mean to ask how might I get the HTML page to load and display sooner in the process?
– sscirrus
Jun 7 at 23:24












Try replacing X11 with DirectFB or SDL. GTK 2 had DirectFB support, but it was removed in GTK 3. Or Webkit has other options besides GTK.
– Ferenc Wágner
Jun 10 at 18:54





Try replacing X11 with DirectFB or SDL. GTK 2 had DirectFB support, but it was removed in GTK 3. Or Webkit has other options besides GTK.
– Ferenc Wágner
Jun 10 at 18:54













 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448250%2f25s-between-systemd-startup-and-actual-display%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay