TerryE
Please post a comment to this issue if you'd like to contribute to this effort.
#3 · open · 4 comments
Please post a comment to this issue if you'd like to contribute to this effort.
I have found out about your project from https://github.com/zendtech/ZendOptimizerPlus/issues/71 I maintain software in a small hosting company. We use mod_fcgid with a hacked APC (using file backed, shared cache, with free space reclaimatiom plus some tweaks). Files are located on tmpfs, madvise(MADV_REMOVE) frees the memory. I have been thinking on porting this approach to ZOP, it looks much cleaner and we have some mixed results with our apc (not wery robust, prone to deadlocks) so I had to develop workarounds (timed locks, cache flush on segfault ect.). Your approch with MLC should be more robust, and it should solve some of the issues we are having with our solution like high memory usage despite madvise() cache reclamation.
At the moment the MLC model assumes a single request per image activation -- that is _not_ using <tt>--enable-fastcgi</tt>, but one of the dialogues that I want to have with Dmitry and the wider team is how OPcache could cover the majority of sapi modes either with base SMA or MLC mode. I am interested in understanding your stack, because Shared Hosting vendors seem to be going the **mod_fcgid** route, so I would be happy to look at covering this as well. BTW, have a look at the wiki pages. My previous attempt at this was a file based variant of APC and that was a horrible hack. The OPcache architecture is just so more aligned to doing this. Either reply here or ping me the details on my mailID which is terry at my ellisons dot org dot uk domain. Thanks.
You are right, I have missed the CGI bit in the docs. The hack we are using for apc should also work for cgi use case (the cache is backed by a mmaped file). I will mail You more details shortly. The basic idea is to use a file on tmpfs as a shared memory, this enables us to attach to same memory segment from processes not forked from the same ancestors. mod_fcgid is better for shared hosting because you can limit the number of processes (we have about 10 000 vhosts on the same machine, all of them can have custom php config. Usually we have under 300 processes, 10 000 fpms whould significantly impact our performance/memory usage.
@lazy404, thanks for this, but can we move the mod_fcgid discussions to issue #6?