[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
log-slow-queries = /var/log/mysql-slow.log
long_query_time = 1
bulk_insert_buffer_size = 16M
join_buffer=2M
key_buffer=256M
max_allowed_packet=64M
max_connections=500
max_heap_table_size = 64M
myisam_sort_buffer_size=128M
query_cache_limit = 16M
query_cache_size = 256M
query_cache_type = 1
query_prealloc_size = 1M
query_alloc_block_size = 2M
read_buffer_size=2M
read_rnd_buffer_size=2M
record_buffer=2M
safe-show-database
skip-innodb
skip-locking
skip-networking
sort_buffer=4M
table_cache=8129
thread_cache_size=2084
thread_concurrency=8
tmp_table_size = 64M
max_join_size = 4294967295
[mysqldump]
max_allowed_packet = 64M
[myisamchk]
key_buffer = 128M
sort_buffer = 128M
read_buffer = 64M
write_buffer = 64M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
APC is a free, open, and robust framework for caching and optimizing PHP intermediate code.
File Cache Information
Cached Files 445 ( 46.6 MBytes)
Hits 765476
Misses 4448
Request Rate (hits, misses) 299.81 cache requests/second
Hit Rate 298.08 cache requests/second
Miss Rate 1.73 cache requests/second
Insert Rate 0.17 cache requests/second
User Cache Information
Cached Variables 9098 ( 97.3 MBytes)
Hits 224235
Misses 34632
Request Rate (hits, misses) 116.92 cache requests/second
Hit Rate 101.28 cache requests/second
Miss Rate 15.64 cache requests/second
Insert Rate 20.58 cache requests/second
Cache full count 0
File Cache Information
Cached Files 665 ( 71.7 MBytes)
Hits 1077559
Misses 4668
Request Rate (hits, misses) 293.68 cache requests/second
Hit Rate 292.42 cache requests/second
Miss Rate 1.27 cache requests/second
Insert Rate 0.18 cache requests/second
Cache full count 0
User Cache Information
Cached Variables 5060 ( 66.9 MBytes)
Hits 322925
Misses 50005
Request Rate (hits, misses) 111.96 cache requests/second
Hit Rate 96.95 cache requests/second
Miss Rate 15.01 cache requests/second
Insert Rate 18.77 cache requests/second
Cache full count 1
APC, кешира извършваните операци като от php скриптовете като заявки към базата данни и върнатите резултати, като по този начин при повторно извикване на същата страница/скрипт, нуждата от извършване на същите тези заявки не същестува по простата причина, че вече са запазени като генерирани файлове и се показва само резултата от тях.
$heavyResult = $database->query('select * from 30 000 000 rows table order by rand() limit 100')->fetchAll();
if( ! $heavyResult = $cachingEngine->get('blabla') ){
$heavyResult = $database->query('select * from 30 000 000 rows table order by rand() limit 100')->fetchAll();
$cachingEngine->add('blabla', $heavyResult);
}