Very high aiCache transactions rates require optimizing your Linux installation. While we try and provide this in the start-up scripts for aiCache certain systems behave differently. Below you can find the specific parameters that need to be set and the methods to validate them.
Adjusting tcp sockets and limits (Dedicated only)
We recommend adjusting default networking settings for maximum performance.For heavy traffic sites set more connections using the following syntax.
echo 256000 > /proc/sys/fs/file-max # Adjust system-wide number of open files
ulimit -n 65535 # Sets number of open files for this process and it's children
ulimit -c 104857600 # 100 Mb max core dump size
Verify your settings with:
cat /proc/sys/fs/file-max # Shows number of files and sockets for this system, must be at least 128000
ulimit -a # Show user limits, check "core file size" and "open files"
Next we decrease TCP TIME_WAIT setting, the default value is too high and will result in too many sockets in TIME_WAIT stait. To decrease waiting time, execute following command:
echo 4 > /proc/sys/net/ipv4/tcp_fin_timeout
To verify setting is in effect, use:
cat /proc/sys/net/ipv4/tcp_fin_timeout # Output should show "4"
Log rotation and log errors (All)
To limit log file size, use:
max_log_file_size 100000000 # Bytes
When set to, aiCache rotates access log file every 100MB or so. The rotated files will have a timestamp appended to the file name.
You can setup RightScale templates to remove those old log files or move them for analysis, but for other setup you must process them manually - via cron jobs, for example.
By default aiCache exits when it can not write to disk, such as when disk is full. Following settings prevent aiCache from exiting in that case:
stay_up_on_write_error
Number of threads (All)
By default aiCache runs 4 threads and it's an optimal setting for virtual servers, large AWS instances and most dual and quad core.
For eight+ core systems you can increase the number of threads used. Set num_workers in global section of the config file.
num_workers 8
To verify number of threads, run CLI or Web statistics command, number of workers is displayed after aiCache version number.