https://issues.apache.org/bugzilla/show_bug.cgi?id=56977
--- Comment #6 from [email protected] --- (In reply to Yann Ylavic from comment #5) > (In reply to bpkroth from comment #3) > > (In reply to Ruediger Pluem from comment #2) > > > Honest opinion: Don't use mod_mem_cache. It does not speed up things > > > compared to mod_disk_cache. mod_mem_cache's cache is not shared between > > > different httpd processes. So you waste more memory for getting less > > > performance. Given that you have enough memory in your server > > > mod_disk_cache > > > content is kept in the buffer caches by the OS. If you don't use SSL stuff > > > is send via sendfile which moves stuff from the buffer caches to the > > > socket > > > directly inside the kernel. If you are using SSL stuff will need to be > > > MMAP > > > which is still very fast. > > > > Yeah, I don't disagree. Under very high load there is a difference between > > mod_mem_cache and mod_disk_cache in so far as the latter requires some extra > > syscalls to the OS for file permissions and handles and the like, which can > > be particularly expensive in a VM environment, but that is kind of an edge > > case. > > A good alternative is also to use mod_disk_cache on a directory which a > (mounted) ramdisk cache. This is a little off topic from what the bug was actually about (errors in mod_mem_cache), but I'll bite. Someone correct me if I'm wrong, but using tmpfs/ramdisk won't avoid your file open(), read()/sendfile(), write(), etc. syscalls from going through the OS to access the cache files instead of just staying in the Apache process space when doing cache lookups. I believe that context switch is what accounts for the performance difference between mod_mem_cache and mod_disk_cache. As Ruediger pointed out, if you have enough memory free, then the OS is already going to do a good job of caching the dirents, inode and data blocks in the page cache anyways, so you shouldn't be seeing any major read performance differences between mod_disk_cache and mod_mem_cache aside from those calls to do the lookups and get handles on the file. Even write performance to the cache shouldn't be too bad given the OS will probably buffer that too and write it out to disk in the background. But I guess the only way to know for sure would be to test it :) All that said, you don't have to convince me not to use mod_mem_cache anymore. Consider this just a heads up that it's broken in some more edge cases. Perhaps a warning to all future users who run across it :) Cheers, Brian -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
