httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Morris <supp...@bettercgi.com>
Subject Re: Sharing information between threads and processes.
Date Thu, 21 Jul 2011 12:55:09 GMT
Using many of the IPC techniques, you may want to minimize the 
amount of writeable shared data, to share only what really must 
be shared. Perhaps instead of sharing some table, only the sum 
of elements in the table actually has to be shared, that type of 
thing. An integer is of course easier to share than a table.

For another option, we found it simple for our application to
separate the part that manipulates and writes shared into a 
separate process. We then use the piped log functionality to send 
request data to the shared external process which processes the 
data, then shares the results via files in the file system. That 
works for us because for most requests the Apache module can 
do a single stat() to see that there is no file indicating that 
special action is required for this request, then the information
about this request is sent down the pipe for later use.

Leveraging piped logging means that the Apache developers who 
came before us already took care of launching and if necessary 
relaunching the process, sharing the pipe filehandle, making
it all cross platform, etc.
-- 
Ray Morris
support@bettercgi.com

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php




On Thu, 21 Jul 2011 14:25:52 +0300
Zaid Amireh <tumbak@gmail.com> wrote:

> 
> On Jul 21, 2011, at 1:53 PM, Nick Kew wrote:
> 
> > 
> > Indirection in shared memory is inherently complex!
> > 
> > How near do the socache modules come to meeting your needs?
> 
> mod_disk_cache would unfortunately make my code pretty complex and
> maybe slow as I'm not caching documents but rather tokens and
> strings. mod_mem_cache is a per-process cache which simply doesn't
> meet the requirements.
> 
> I'm open to any wild ideas :)
> 
> virtually yours
> 
> Zaid


Mime
View raw message