[CentOS] Centos/Linux Disk Caching, might be OT in some ways

Tue Jan 26 00:38:29 UTC 2010
nate <centos at linuxpowered.net>

Noob Centos Admin wrote:

> The web application is written in PHP and runs off MySQL and/or
> Postgresql. So I don't think I can access the raw disk data directly,
> nor do I think it would be safe since that bypasses the DBMS's checks.

This is what I use for MySQL (among other things)

log-queries-not-using-indexes
long_query_time=3
key_buffer = 50M
bulk_insert_buffer_size = 8M
table_cache = 1000
sort_buffer_size = 8M
read_buffer_size = 4M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 8M
thread_cache = 40
query_cache_size = 256M
query_cache_type=1
query_cache_limit=20M

default-storage-engine=innodb
innodb_file_per_table
innodb_buffer_pool_size=20G <-- assumes you have a decent amount of ram,
this is the max I can set the buffers with 32G of RAM w/o swapping
innodb_additional_mem_pool_size=20M
innodb_log_file_size=1999M
innodb_flush_log_at_trx_commit=2
innodb_flush_method=O_DIRECT <-- this turns on Direct I/O
innodb_lock_wait_timeout=120
innodb_log_buffer_size=13M
innodb_open_files=1024
innodb_thread_concurrency=16
sync_binlog=1
set-variable = tmpdir=/var/lib/mysql/tmp <- force tmp to be on the SAN
rather than local disk

Running MySQL 5.0.51a (built from SRPMS)

nate