While reading articles about optimization, I read about the accf_http module.
The man page of the module is here, where you can read:
The utility of accf_http is such that a server will not have to context switch several times before performing the initial parsing of the request.
To load this module, use the following command:
# kldload accf_http
To load it at boot time, add the following line in /boot/loader.conf:
accf_http_load="YES"
To check if the module is loaded, use the command kldstat:
# kldstat Id Refs Address Size Name 1 4 0xc0400000 906518 kernel 2 1 0xc0d07000 6a32c acpi.ko 3 1 0xc5e65000 2000 accf_http.ko
This entry was written by , posted on March 12, 2009 at 6:04 am, filed under Optimization and tagged FreeBSD. Leave a comment or view the discussion at the permalink.
As you may know, when using memcached on 32-bit servers, processes can only address 4GB of virtual memory making the memcached daemon handle only 2 or 3 Gb of memory.
If you want to address more memory, you need to launch multiple memcached daemons.
I wrote an rc script , mmemcached, for FreeBSD to manage this.
To use it, you need to add this in /etc/rc.conf:
mmemcached_enable="YES" mmemcached_servers="1 2" mmemcached_user="nobody" mmemcached_args="-c 8192 -t 2 -m 2048 -d"
Copy the mmemcached script in /usr/local/etc/rc.d for example and launch it with the start argument. With the above configuration it will launch two memcached daemons listening on ports 11211 and 11212 (mmemcached_servers parameter) with 2Gb of memory.
Details of the rc.conf configuration:
Download the script on github.
This entry was written by , posted on October 2, 2008 at 12:23 pm, filed under Distro, Uncategorized and tagged FreeBSD, memcached. Leave a comment or view the discussion at the permalink.
To rotate your nginx log files, you can use the log file handler provided by FreeBSD: newsyslog.
/var/log/nginx-access.log 644 7 1024 * JC /var/run/nginx.pid /var/log/nginx-error.log 644 7 1024 * JC /var/run/nginx.pid
Before log rotation:
-rw-r--r-- 1 root wheel 104278002 Jul 16 11:35 nginx-access.log -rw-r--r-- 1 root wheel 1509531 Jul 16 11:17 nginx-error.log
After log rotation:
-rw-r--r-- 1 root wheel 967 Jul 16 12:42 nginx-access.log -rw-r--r-- 1 root wheel 5310443 Jul 16 12:41 nginx-access.log.0.bz2 -rw-r--r-- 1 root wheel 77 Jul 16 12:41 nginx-error.log -rw-r--r-- 1 root wheel 37552 Jul 16 12:41 nginx-error.log.0.bz2
This entry was written by , posted on July 17, 2008 at 7:15 am, filed under Logs and tagged FreeBSD, newsyslog, nginx. Leave a comment or view the discussion at the permalink.