Ask a Question related to FreeBSD, Design and Development.

  1. #1

    Default Optimising FreeBSD

    Hi all,

    I'm still fairly new to this, so I hope you all don't mind another
    question. Actually, several questions!!!!

    First let me explain what I have, then what I want to do.

    I have 2 machines which I want to run FreeBSD on. So far I have set one
    of them up, a P-II machine, as a file & print server. Next set up a
    P-III machine for day to day use as a workstation.

    Since neither of these machines are particularly powerful I want to be
    able to optimise the performance of them both. I don't mind sitting and
    waiting for compiles now it if means better performance later.
    Particularly on the workstation as I will be doing some fairly intensive
    things on it (eg multimedia).

    So on the P-II machine I installed 5.3-RELEASE with no problems. I then
    re-built the kernel with the I686_CPU option set and a load of
    unnecessary drivers removed. This saved about 4MB right away. I then
    used CVSup to update the ports and installed Samba and one or two
    others. I thought I was doing pretty well since I can print and read
    files from both Windows and other *NIX machines, but I have since
    realised that I probably don't have the best optimisations in place.

    Having spent some more time reading the handbook and various bits on the
    web I think I know what to do, but would really appreciate some
    independent confirmation.

    First, I think I need to edit the /etc/make.conf file. This is what I
    think I should have in place:

    CPUTYPE ?= p2 # or p3 on my workstation
    CFLAGS = -O -pipe # O2 and above not recommended?
    COPTFLAGS= -O -pipe

    I am not sure I understand the difference between CFLAGS and COPTFLAGS.
    Am I right in saying that COPTFLAGS is used for kernel builds and CFLAGS
    is used for everything else? If so, should they be set the same, or can
    I safely increase the -O setting in CFLAGS?

    Is there anything else I need to set?

    Assuming the settings above are right, now I guess I can rebuild my
    kernel again without changing the configuration but I should now have p2
    specific code? Is there anything in the kernel config file I need to
    check? Do I even need to rebuild since I had the I686_CPU setting?

    Next I guess I need to re-build the rest of the userland apps. Is it
    simply a case of building world, or do I have to go through the whole
    upgrade procedure as described in the Handbook?

    I want to stick to -RELEASE, does this change (bug/security fixes)? If
    so, how do I update? I can see CVSup config files for -CURRENT and
    -STABLE, but not for -RELEASE.

    I guess the last step is to recompile the ports I have installed. Is
    there a quick way to rebuild just the ports I have installed or do I
    need to go through them all one by one and 'make install clean' them?

    Anything else I have missed?

    Sorry for so many questions in one go!

    Many thanks in advance,
    Rich

    Richard Danter Guest

  2. Similar Questions and Discussions

    1. Optimising queries
      Hi! I wonder if anyone can tell me if there is anything I can do to make this set of queries a lot more efficient. Right now I have this code...
    2. Compile FreeBSD RELENG_5 on FreeBSD 4-STABLE
      Hi. I have a FreeBSD 4-STABLE machine. I want to do my custom RENELG_5 FreeBSD release. I'm get all RELENG_5 CVS source (with cvs checkout...
    3. Optimising a web app
      I have a web app using C# for coding. I need to track the "memory usage" and "performance" of the application. Are there any tools available for...
    4. Optimising speed
      Hello I made a webpage with 2 flash films and a navigation bar which is a javascript applet. They start all three at the same moment. Both movies...
    5. optimising flash for the web
      hi does anyone have any advice on how to optimise for quickest download time? for an entire flash site, is it better to have one swf with...
  3. #2

    Default Re: Optimising FreeBSD

    On Sunday 27 February 2005 16:32, Richard Danter wrote:
    >...
    > I guess the last step is to recompile the ports I have installed. Is
    > there a quick way to rebuild just the ports I have installed or do I
    > need to go through them all one by one and 'make install clean' them?
    >
    The easiest way is to use portupgrade

    portupgrade -fa will work, but I tend to use something like this:

    portupgrade -f '<2005-02-27 16:40'

    which means force a rebuild of ever port built before the given time. This can
    be restarted if a build fails or you need to stop and restart.
    RW Guest

  4. #3

    Default RE: Optimising FreeBSD

    > -----Original Message-----
    > From: [email]owner-freebsd-questions@freebsd.org[/email] [mailto:owner-freebsd-
    > [email]questions@freebsd.org[/email]] On Behalf Of Richard Danter
    > Sent: Sunday, February 27, 2005 22:03
    > To: [email]freebsd-questions@freebsd.org[/email]
    > Subject: Optimising FreeBSD
    >
    > First, I think I need to edit the /etc/make.conf file. This is what I
    > think I should have in place:
    >
    > CPUTYPE ?= p2 # or p3 on my workstation
    > CFLAGS = -O -pipe # O2 and above not recommended?
    > COPTFLAGS= -O -pipe
    Make that CPUTYPE=p2 instead of CPUTYPE?=p2. The later is used if you build
    for p2 on a different platform. CFLAGS and COPTFLAGS look ok. You can try
    -O2 for COPTFLAGS but expect some instabilities.
    >
    > I am not sure I understand the difference between CFLAGS and COPTFLAGS.
    > Am I right in saying that COPTFLAGS is used for kernel builds and CFLAGS
    > is used for everything else?
    That's correct
    >
    > Is there anything else I need to set?
    Go through /usr/local/sys/i386/conf/NOTES. Read through the different
    processor flags.
    >
    > Assuming the settings above are right, now I guess I can rebuild my
    > kernel again without changing the configuration but I should now have p2
    > specific code? Is there anything in the kernel config file I need to
    > check? Do I even need to rebuild since I had the I686_CPU setting?
    Just rebuilding the kernel after modifying make.conf should be enough.
    >
    > Next I guess I need to re-build the rest of the userland apps. Is it
    > simply a case of building world, or do I have to go through the whole
    > upgrade procedure as described in the Handbook?
    Yeh a rebuild of world is necessary. Well, not necessary but definitely
    recommended.

    >
    > I want to stick to -RELEASE, does this change (bug/security fixes)? If
    > so, how do I update? I can see CVSup config files for -CURRENT and
    > -STABLE, but not for -RELEASE.
    RELENG_X means FreeBSD X-STABLE, RELENG_X_Y means FreeBSD X.Y-RELEASE.
    Read through the "make world" section of the handbook again.
    >
    > I guess the last step is to recompile the ports I have installed. Is
    > there a quick way to rebuild just the ports I have installed or do I
    > need to go through them all one by one and 'make install clean' them?
    >
    > Anything else I have missed?
    The simplest way I would do is pkg_delete -ad. This would delete *all* the
    installed ports. Then selectively rebuild the ports as required.
    > Sorry for so many questions in one go!
    You don't learn something unless you have the guts to ask, so be proud about
    it. :-)

    Regards,
    S.

    Indian Institute of Information Technology
    Subhro Sankha Kar
    Block AQ-13/1, Sector V
    Salt Lake City
    PIN 700091
    India

    Subhro Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139