Discussion:
Speed up CD/DVD-based FreeBSD
(too old to reply)
O. Hartmann
2018-03-12 05:35:26 UTC
Permalink
We have a special case of running FreeBSD (actually a NanoBSD) from a CD/DVD.
The reason behind using a CD/DVD is to prevent manipulations.

Now, after the GUI hass started, the system autologin a user and autostarts
Firefox. But starting Firefox takes ~ 5 - 7 minutes, while the operating system
takes 2 - 3 minutes. As you can imagine, this isn't quite a useful time.

Is there a simple way, considering enough RAM in the box, to speed up the
process? Loading Firefox makes the DVD drive moving the head very often - I
assume this is the fact because I can hear the head scratiching around very
intense.

Does FreeBSD bring tools/facilities onboard to achive what I'm requesting or do
I need an additional port/softwarepackage?

Any considerations are welcome.

Thanks in advance,

Oliver
Rodney W. Grimes
2018-03-12 07:30:18 UTC
Permalink
Post by O. Hartmann
We have a special case of running FreeBSD (actually a NanoBSD) from a CD/DVD.
The reason behind using a CD/DVD is to prevent manipulations.
Now, after the GUI hass started, the system autologin a user and autostarts
Firefox. But starting Firefox takes ~ 5 - 7 minutes, while the operating system
takes 2 - 3 minutes. As you can imagine, this isn't quite a useful time.
Is there a simple way, considering enough RAM in the box, to speed up the
process? Loading Firefox makes the DVD drive moving the head very often - I
assume this is the fact because I can hear the head scratiching around very
intense.
Does FreeBSD bring tools/facilities onboard to achive what I'm requesting or do
I need an additional port/softwarepackage?
Are you custom building this CD-rom image, or is it just a slightly modified
stock FreeBSD distritbution with some scripts?

One suggestion would be to run from a mfs /usr, including /usr/local,
as a sample on how to do this take a look at /etc/rc.initdiskless
that does this for /etc and /var when booting diskless.

I suspect your slow down is shared library linking time, which
would mean you might also solve this problem by building a staticly
linked firefox binary. This would be much simpler to try out.
--
Rod Grimes ***@freebsd.org
Andreas Nilsson
2018-03-12 08:00:28 UTC
Permalink
On Mon, Mar 12, 2018 at 8:30 AM, Rodney W. Grimes <
Post by O. Hartmann
Post by O. Hartmann
We have a special case of running FreeBSD (actually a NanoBSD) from a
CD/DVD.
Post by O. Hartmann
The reason behind using a CD/DVD is to prevent manipulations.
Now, after the GUI hass started, the system autologin a user and
autostarts
Post by O. Hartmann
Firefox. But starting Firefox takes ~ 5 - 7 minutes, while the operating
system
Post by O. Hartmann
takes 2 - 3 minutes. As you can imagine, this isn't quite a useful time.
Is there a simple way, considering enough RAM in the box, to speed up the
process? Loading Firefox makes the DVD drive moving the head very often
- I
Post by O. Hartmann
assume this is the fact because I can hear the head scratiching around
very
Post by O. Hartmann
intense.
Does FreeBSD bring tools/facilities onboard to achive what I'm
requesting or do
Post by O. Hartmann
I need an additional port/softwarepackage?
Are you custom building this CD-rom image, or is it just a slightly modified
stock FreeBSD distritbution with some scripts?
One suggestion would be to run from a mfs /usr, including /usr/local,
as a sample on how to do this take a look at /etc/rc.initdiskless
that does this for /etc and /var when booting diskless.
I suspect your slow down is shared library linking time, which
would mean you might also solve this problem by building a staticly
linked firefox binary. This would be much simpler to try out.
--
Rod Grimes
Hello,

doesn't nanoBSD run in ro-mode per default, ie it should be somewhat tamper
proof as is, even installed on disk.

If running from optical drive is important, I would have a closer look on
how pcbsd/trueos sets up their install-discs ( or at least used to, haven't
tried one in a while ) where they basically load the entire file system
into ram from a compressed image on the optical disc.

Best regards
Andreas
Hartmann, O.
2018-03-14 16:13:27 UTC
Permalink
On Mon, 12 Mar 2018 09:00:28 +0100
Andreas Nilsson <***@gmail.com> wrote:


Sorry for the late reply, I'll answer inline, see below.
Post by Andreas Nilsson
On Mon, Mar 12, 2018 at 8:30 AM, Rodney W. Grimes <
Post by O. Hartmann
Post by O. Hartmann
We have a special case of running FreeBSD (actually a NanoBSD) from a
CD/DVD.
Post by O. Hartmann
The reason behind using a CD/DVD is to prevent manipulations.
Now, after the GUI hass started, the system autologin a user and
autostarts
Post by O. Hartmann
Firefox. But starting Firefox takes ~ 5 - 7 minutes, while the operating
system
Post by O. Hartmann
takes 2 - 3 minutes. As you can imagine, this isn't quite a useful time.
Is there a simple way, considering enough RAM in the box, to
speed up the process? Loading Firefox makes the DVD drive moving
the head very often
- I
Post by O. Hartmann
assume this is the fact because I can hear the head scratiching around
very
Post by O. Hartmann
intense.
Does FreeBSD bring tools/facilities onboard to achive what I'm
requesting or do
Post by O. Hartmann
I need an additional port/softwarepackage?
Are you custom building this CD-rom image, or is it just a slightly modified
stock FreeBSD distritbution with some scripts?
I do not understand correctly what you mean by "stock FreeBSD". I do
not change the sources. It is mostly NanoBSD-driven, but the resulting
system is highly minimalistic by excluding those parts of the OS which
are usually not needed when running embedded applications apart from
development. So, there are lots of WITHOUT_ tags while building and
more importantly while installing the resulting image.

The image itself is "custom made", since NanoBSD doesn't offer a proper
CD9660 build script. But, it isn't hard to add some functionality to
achive this task.


The "bloat" of 2,6 GB size comes from the utoization of X11,
windowmaker and not at last Firefox itself. I'll try to reduce the size
by using x11/xorg-minimal with adding missing/required ports manually,
but this issue is another one.

The meaning of "having enough/plenty of RAM" is: I'm willing to use at
least 2GB RAM, at the moment I have 4GB in the box, but 8 is also
possible. But this box has only one purpose: offering Firefox for
checking on a remote server for some data. So any RAM more than
necessary is a waste of resources.
Post by Andreas Nilsson
Post by O. Hartmann
One suggestion would be to run from a mfs /usr,
including /usr/local, as a sample on how to do this take a look
at /etc/rc.initdiskless that does this for /etc and /var when
booting diskless.
I'll check this, thanks for the hint.
Post by Andreas Nilsson
Post by O. Hartmann
I suspect your slow down is shared library linking time, which
would mean you might also solve this problem by building a staticly
linked firefox binary. This would be much simpler to try out.
FreeBSD 11.1-RELENG-p7 boot time itself is ~ 3 - 5 minutes (4
core/thread Haswell customer CPU at >3 GHz and 8 GB RAM from DVD ROM).
Starting X11 takes another 3 minutes and when windowmaker shows up
starting Firefox, it takes overall more than 35 minutes until Firefox
is started and usable. The box is supposed to run 24/7, but consider a
power surge or lightouts, it is indisputable that booting takes to long.

Linking Firefox statically would take precautions in the poudriere
package builder we run for such tasks - well, I guess this would be
achivable, but for the sake of being most flexible in terms of we can
use ANY repository I would consider a static linking approach a last
resort.
Post by Andreas Nilsson
Post by O. Hartmann
--
Rod Grimes
Hello,
doesn't nanoBSD run in ro-mode per default, ie it should be somewhat
tamper proof as is, even installed on disk.
Well, NanoBSD can be configured to mount / ro, but this can be changed.
Running from a DVD ROM provides a better tamper proof solution and I
would prefere the DVD ROM in favour of a potentially writable medium.
At this very moment the test system runs from an USB flash device and
is fairly fast in bootup, > 3 minutes at from hitting the power button
up to have Firefox opened and ready to work.
Post by Andreas Nilsson
If running from optical drive is important, I would have a closer
look on how pcbsd/trueos sets up their install-discs ( or at least
used to, haven't tried one in a while ) where they basically load the
entire file system into ram from a compressed image on the optical
disc.
Well, thanks for the hint.
Post by Andreas Nilsson
Best regards
Andreas
Kind regards,

Oliver
Rozhuk Ivan
2018-03-14 19:08:21 UTC
Permalink
On Wed, 14 Mar 2018 17:13:27 +0100
Post by Hartmann, O.
The image itself is "custom made", since NanoBSD doesn't offer a
proper CD9660 build script. But, it isn't hard to add some
functionality to achive this task.
May be geom_cache can help increase random read speed?

Ian Lepore
2018-03-12 14:32:38 UTC
Permalink
Post by O. Hartmann
We have a special case of running FreeBSD (actually a NanoBSD) from a CD/DVD.
The reason behind using a CD/DVD is to prevent manipulations.
Now, after the GUI hass started, the system autologin a user and autostarts
Firefox. But starting Firefox takes ~ 5 - 7 minutes, while the operating system
takes 2 - 3 minutes. As you can imagine, this isn't quite a useful time.
Is there a simple way, considering enough RAM in the box, to speed up the
process? Loading Firefox makes the DVD drive moving the head very often - I
assume this is the fact because I can hear the head scratiching around very
intense.
Does FreeBSD bring tools/facilities onboard to achive what I'm requesting or do
I need an additional port/softwarepackage?
Any considerations are welcome.
Thanks in advance,
Oliver
You say you have "enough" ram... is it enough to fit your entire
filesystem image in memory and still be able to run apps?  If so you
can compile your entire filesystem into the kernel using an mdroot
image using options MD_ROOT and makeoptions MFS_IMAGE=<filename>.

-- Ian
Rodney W. Grimes
2018-03-14 17:20:08 UTC
Permalink
Post by Hartmann, O.
On Mon, 12 Mar 2018 09:00:28 +0100
Sorry for the late reply, I'll answer inline, see below.
Post by Andreas Nilsson
On Mon, Mar 12, 2018 at 8:30 AM, Rodney W. Grimes <
Post by O. Hartmann
Post by O. Hartmann
We have a special case of running FreeBSD (actually a NanoBSD)
from a
CD/DVD.
Post by O. Hartmann
The reason behind using a CD/DVD is to prevent manipulations.
Now, after the GUI hass started, the system autologin a user and
autostarts
Post by O. Hartmann
Firefox. But starting Firefox takes ~ 5 - 7 minutes, while the
operating
system
Post by O. Hartmann
takes 2 - 3 minutes. As you can imagine, this isn't quite a
useful time.
Is there a simple way, considering enough RAM in the box, to
speed up the process? Loading Firefox makes the DVD drive moving
the head very often
- I
Post by O. Hartmann
assume this is the fact because I can hear the head scratiching
around
very
Post by O. Hartmann
intense.
Does FreeBSD bring tools/facilities onboard to achive what I'm
requesting or do
Post by O. Hartmann
I need an additional port/softwarepackage?
Are you custom building this CD-rom image, or is it just a slightly
modified
stock FreeBSD distritbution with some scripts?
I do not understand correctly what you mean by "stock FreeBSD". I do
I was refering to one of the .iso files avaliable on FreeBSD.org.
Post by Hartmann, O.
not change the sources. It is mostly NanoBSD-driven, but the resulting
system is highly minimalistic by excluding those parts of the OS which
are usually not needed when running embedded applications apart from
development. So, there are lots of WITHOUT_ tags while building and
more importantly while installing the resulting image.
The image itself is "custom made", since NanoBSD doesn't offer a proper
CD9660 build script. But, it isn't hard to add some functionality to
achive this task.
So you are running a roll your own release, and not a stock
FreeBSD image, this makes it easier to fix your performance
related issue.

O(1) would be to get /lib and /usr/lib/... in a tmpfs memory file
system, then probably /usr/local/lib. This is not a huge amount
of memory:
6522 /lib
55317 /usr/lib
639983 /usr/local/lib

fyi, firefox has a chunk in /usr/local/lib:
du -s /usr/local/lib/firefox/
79768 /usr/local/lib/firefox/

My /usr/local/lib is probably significantly larger than yours,
as I have full X11 + many apps, including firefox:
pkg info | wc -l
448
Post by Hartmann, O.
The "bloat" of 2,6 GB size comes from the utoization of X11,
windowmaker and not at last Firefox itself. I'll try to reduce the size
by using x11/xorg-minimal with adding missing/required ports manually,
but this issue is another one.
If your whole custom image is only 2.6GB then running this all
in RAM would not be hard to do with a 4GB machine, and very
comfortable in 8GB. Reducing this to 2GB would leave you a
2GB of ram for firefox to eat away, and that should be enough.
Post by Hartmann, O.
The meaning of "having enough/plenty of RAM" is: I'm willing to use at
least 2GB RAM, at the moment I have 4GB in the box, but 8 is also
possible. But this box has only one purpose: offering Firefox for
checking on a remote server for some data. So any RAM more than
necessary is a waste of resources.
It looks like 1G of ram dedicated to tmpfs would probably
make your problem disappear. DVD drives are not good for
random access, and thats what your doing a lot of here,
especially when doing the dynamic linking at exec time.
Post by Hartmann, O.
Post by Andreas Nilsson
Post by O. Hartmann
One suggestion would be to run from a mfs /usr,
including /usr/local, as a sample on how to do this take a look
at /etc/rc.initdiskless that does this for /etc and /var when
booting diskless.
I'll check this, thanks for the hint.
Post by Andreas Nilsson
Post by O. Hartmann
I suspect your slow down is shared library linking time, which
would mean you might also solve this problem by building a staticly
linked firefox binary. This would be much simpler to try out.
FreeBSD 11.1-RELENG-p7 boot time itself is ~ 3 - 5 minutes (4
core/thread Haswell customer CPU at >3 GHz and 8 GB RAM from DVD ROM).
Starting X11 takes another 3 minutes and when windowmaker shows up
starting Firefox, it takes overall more than 35 minutes until Firefox
is started and usable. The box is supposed to run 24/7, but consider a
power surge or lightouts, it is indisputable that booting takes to long.
Linking Firefox statically would take precautions in the poudriere
package builder we run for such tasks - well, I guess this would be
achivable, but for the sake of being most flexible in terms of we can
use ANY repository I would consider a static linking approach a last
resort.
Post by Andreas Nilsson
Post by O. Hartmann
--
Rod Grimes
Hello,
doesn't nanoBSD run in ro-mode per default, ie it should be somewhat
tamper proof as is, even installed on disk.
Well, NanoBSD can be configured to mount / ro, but this can be changed.
Running from a DVD ROM provides a better tamper proof solution and I
would prefere the DVD ROM in favour of a potentially writable medium.
At this very moment the test system runs from an USB flash device and
is fairly fast in bootup, > 3 minutes at from hitting the power button
up to have Firefox opened and ready to work.
Post by Andreas Nilsson
If running from optical drive is important, I would have a closer
look on how pcbsd/trueos sets up their install-discs ( or at least
used to, haven't tried one in a while ) where they basically load the
entire file system into ram from a compressed image on the optical
disc.
Well, thanks for the hint.
Post by Andreas Nilsson
Best regards
Andreas
Kind regards,
Oliver
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
--
Rod Grimes ***@freebsd.org
Continue reading on narkive:
Loading...