Optimising FreeBSD

2005-02-27 Thread Richard Danter
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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Optimising FreeBSD

2005-02-27 Thread RW
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. 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Optimising FreeBSD

2005-02-27 Thread Subhro

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:owner-freebsd-
 [EMAIL PROTECTED] On Behalf Of Richard Danter
 Sent: Sunday, February 27, 2005 22:03
 To: freebsd-questions@freebsd.org
 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


smime.p7s
Description: S/MIME cryptographic signature


FW: Optimising FreeBSD

2005-02-27 Thread Subhro



 -Original Message-
 From: Richard Danter [mailto:[EMAIL PROTECTED]
 Sent: Sunday, February 27, 2005 23:13
 To: Subhro
 Subject: Re: Optimising FreeBSD
 
 Subhro wrote:
 
  Yeh a rebuild of world is necessary. Well, not necessary but definitely
  recommended.
 
 So just to be clear, just doing a 'make buildworld' is enough? I don't
 need to do the install and mergemaster steps? How about rebooting?
 
 Thanks for taking the time to answer my questions, I really do
 appreciate it.
 
 Rich 

Richard, just a friendly advice, make it a point to always CC to the
freebsd-questions because there are people who learn from here.

Regards
S.

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


smime.p7s
Description: S/MIME cryptographic signature


Re: Optimising FreeBSD

2005-02-27 Thread Adam McMaster
On 27 Feb 2005, at 16:32, Richard Danter wrote:
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?
I have one piece of advice, if you're using the if_ndis module don't  
build it with custom CPUTYPE values.  In my experience doing so can  
stop it working.  See the below post I made:

http://lists.freebsd.org/pipermail/freebsd-hardware/2005-January/ 
002172.html

It's not too difficult to build that one module with the default  
CPUTYPE and still use a custom value for the rest, and doing so hasn't  
caused me any problems.

--
- Adam McMaster [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]