Matt points to a PHP script that uses shm memory to cache data.
I rather use the filesystem to cache data – disk access is an order of magnitude slower than memory accesses but the operating system is generally clever about caching filesystem reads in memory. I would presume that the algorithms used are more complex than can be practically achieved by a PHP script too.
AFAIR, Apache has problems with Shm segments too although that could be something I remember from long ago!
You might also like
- CamWorld, caching?
Has Cam restored his old site? Or is my ISP- WordPress, Smarty and Multi-Blogs
My Smarty powered and mult-blog capable version of WordPress is- PHP, MVC And Smarty Caching
Following on from previous posts on PHP and MVC and
If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos and funny videos to explore too!
buffer cache calls (e.g. fread/fwrite) are always system calls so will incur context switches, buffering, etc.
whereas process memory accesses can be local pages –
so no, the OS won’t necessary be better for FS calls..
debuging multiprocess applications is a bit tricky though,
but same could be said for filesytstems.
mmap should be comprable