0

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-systemd\x2dbacklight.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?
  • 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 '18 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 '18 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 '18 at 17:22
  • 1
    Seems fairly good the time. – Rui F Ribeiro Jun 6 '18 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 '18 at 13:01
0

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.

  • 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 '18 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 '18 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.