PHP caching: shm vs. apc vs. memcache vs. mysql vs. file cache (update: fill apc from cron)
Lessons learned: shm/apc are 32-60 times faster than memcached or mysql shm/apc are 2 times faster than php file cache with apc php file cache with apc is 15-24 times faster than memcached or mysql mysql is 2 times faster than memcached when storing more than 400 bytes memcached is 2 times faster than mysql when storing less than 400 bytes php file cache with apc is 2-3 times faster than normal file cache php file cache without apc is 8 times slower than normal file cache Tests were made with PHP 5.3.10, MySQL 5.5.29, memcached 1.4.13, 64bit, 3.4GHz (QEMU): shm 0.031 0.020 0.021 0.021 0.026 0.028 0.032 0.042 0.084 0.155 0.290 0.629 0.110 Total: 1.489, Avg: 0.115 apc 0.025 0.025 0.025 0.026 0.031 0.036 0.043 0.060 0.106 0.171 0.328 0.756 0.097 Total: 1.728, Avg: 0.133 memcache 3.116 3.014 3.005 3.072 3.077 3.910 3.929 4.067 4.308 10.371 15.323 25.013 3.281 Total: 85.488, Avg: 6.576 memcache socket 1.736 1.756 1.981 1.780 1.809 1.907 1.941 1.983 2.225 9.368 14.071 24.897 1.979 Total: ...