> On Mon, 12 Mar 2018 09:00:28 +0100
> Andreas Nilsson <andrn...@gmail.com> wrote:
> Sorry for the late reply, I'll answer inline, see below.
> > On Mon, Mar 12, 2018 at 8:30 AM, Rodney W. Grimes <
> > freebsd-...@pdx.rh.cn85.dnsmgr.net> wrote:
> > 
> > > > 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?
> 
> 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.

> 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

> 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.

> 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.

> > > 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.
> 
> > >
> > > 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.
> 
> > >
> > > --
> > > Rod Grimes
> > > rgri...@freebsd.org
> > >  
> > 
> > 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.
> 
> > 
> > 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. 
> 
> > 
> > Best regards
> > Andreas
> 
> Kind regards,
> 
> Oliver
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
> 

-- 
Rod Grimes                                                 rgri...@freebsd.org
_______________________________________________
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to