FreeBSD 6.1 Performance Tuning

Just a note for myself to tune FreeBSD OS for better performance.

Partitioning
Every partition of the disk will required different usage. For example webserver needs a lot reading and database needs read and write. Beside that, /var is a place to keep logs/transactions/mail and etc, require a lot of read and write too. It will be better if every disk partition for its own needs. Usually I do;
2G – /swap
2G – /var
5G – /www
10G – /db
5G – /usr
10G – /
the rest of the disk – /home

Size of a disk partition is depend on your own needs.

Syscontrol – sysctl

net.inet.tcp.sendspace/net.inet.tcp.recvspace – Tune this if you are running heavy traffic web server. Its control the send/receive buffer space for any TCP connection.

kern.ipc.somaxconn – Default somaxconn is 128, it’s not suitable running on heavy webserver, increase it to higher value cater your needs. Mine default is always set to 1024.

kern.maxfiles – If you running large database server, increase of kern.maxfiles will enhance your database server performance. Use kern.openfiles to determine current openfiles value on server.

Related posts:

  1. PostgreSQL Performance Tuning Compilation Performance Tuning PostgreSQL by Frank Wiles PostgreSQL 8.0 Performance Checklist...
  2. mount hfsplus (mac os file system) under Debian linux Have an external hard disk with hfsplus or hfs+ partition...
  3. Format Your External Hard Disk That Support Mac and Windows with Apple OSX If you have an external hard disk or thumb drive...
  4. Bind Error: “max open files (3520) is smaller than max sockets (4096)” Just notice one of the DNS server has the error...
  5. Forget / forgot / cannot remember root password On a FreeBSD server 1. reboot server 2. choose to...
  6. MySQL 5 Server Cannot Start on Apple Mac Leopard There were some problem during configuring MySQL5 Server on Leopard...
  7. How to Install FreeBSD 5.4 on Your Machine FreeBSD is an advanced operating system for x86 compatible (including...
  8. Exim, refused: too many connections One of our mailserver having problem last week. It’s caused...
  9. MySQL Quick Installation on FreeBSD Quick installation of MySQL Database on FreeBSD Server. Make sure...
  10. installing postgresql 8.2 on Leopard with macports postgresql! one of my favorite high performance open source db,...

2 Responses to “FreeBSD 6.1 Performance Tuning”

  1. chfl4gs_ Says:

    Besides what you have mentioned above, you should look into :-
    In /etc/sysctl.conf
    kern.maxfilesperproc
    kern.maxprocperuid
    kern.ipc.nmbclusters

    In /boot/loader.conf
    kern.ipc.maxpipekva
    vm.kmem_size_max
    kern.maxproc
    kern.ipc.maxsockbuf

  2. chfl4gs_ Says:

    oh btw thanks for the belated birthday greeting :-)

Leave a Reply