October 2007 Archives

First of all, I rebuilt the FreeBSD kernel, the main purpose was to remove unnecessary  driver components such  as CPU type, SCSI, network adapter and USB support, they are not needed on my server at all.

Modify /usr/src/sys/i386/conf/GENERIC file to remove the unnecessary entries. Before that, you should be familiar with your hardware model.

Then  compile and install the kernel:

  • /usr/sbin/config  GENERIC
  • cd ../compile/GENERIC
  • make cleandepend && make depend
  • make
  • make  install

You need  modify the GENERIC  configuration file if you  get any error  during the 'make'.

At last, reboot the system.

Secondly, enable the 'Soft Updates' to improve the disk performance.

You should enter the single user mode (boot -s) to finish the task.

  • /sbin/tunefs -n enable /home
  • /sbin/tunefs -n enable /tmp
  • /sbin/tunefs -n enable /var
  • /sbin/tunefs -n enable /other_partition


The root partition / is not recommended to enable 'Soft Update'

And then reboot the system.

Verify: when the system is up, type 'mount' to check if 'Soft Updates' is enabled or not, on my system, I enabled this feature for each partition.

[root@www ~]# mount
/dev/ad0s1a on / (ufs, local, soft-updates)
devfs on /dev (devfs, local)
/dev/ad0s1f on /home (ufs, local, soft-updates)
/dev/ad0s1d on /tmp (ufs, local, soft-updates)
/dev/ad0s1g on /usr (ufs, local, soft-updates)
/dev/ad0s1e on /var (ufs, local, soft-updates)

How disk performance improved?

I did a disk read/write test by using a simple C language program.

# ./postmark
pm>set size 10000 20000
pm>set number 1000
pm>set transactions 50000
pm>run

Before tuning:

1 Transactions/s: 34
2 DATE READ: 272.96 K/S
3 DATE WRITTEN: 281.46K/S

After tuning:

1 Transactions/s: 122
2 DATE READ: 983.70 K/S
3DATE WRITTEN: 1014.33K/S

So we can see that 'Soft Updates' feature improves the disk performance greatly.

For more details, please refer to the official document about 'Soft Updates'

Powered by FreeBSD now!

| | Comments (0) | TrackBacks (0)

Today, I migrated my site from original RedHat Linux to FreeBSD 6.2 Release!?

Many years ago, I installed FreeBSD 4.2 stable on a PC (Celeron CPU and low memory), which was running Apache, MySQL, Proftp and qmail, after tuning and re-compiled the kernel, the performance was perfect!

Next step, I will try to use cvs to upgrade it to Stable version. Stay tune...