[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modules
Subject:    [apache-modules] Processes, threads, global data and apache modules
From:       Valerio Ferrucci <valfer () flashnet ! it>
Date:       2001-02-28 18:38:04
[Download RAW message or body]

Hi,
I'm building an apache plugin that process html pages.
I have two problem bulding my app as an Apache module:

1) I need some global data (for example a cache with my often used
files). I initialize this in module_init. So I have N caches for N child
processes forked by Apache wasting uslessly memory. Of course this
happens also for other data, as global lists etc...

2) I use JNI (Java Native Intarface) and Java Invocation API to call
Java classes from my plugin. So I have to link my plugin against Java
Native Threads lib. Apache will crash very soon if loads modules which
link against "Java Native Threads lib" and "libpthread.so"!
It's very usual to find libpthread.so in Apache (for example php with
oracle requires it).

I resolved this two problems creating a separate application (server)
responding to the apache plugin (client) via (local) TCP/IP. The apache
plug-in does nothing but calling the server with http parameters. Almost
all code (comprise pthread, Java etc..) is in the server.

This works but unfortunately now I have a 30% slower response compared
with the plugin version.

Questions:
- is there some way to communicate between two process (apache and my
app) faster than TCP/IP  (to save that 30% of overhead), for example
IPC, pipes, shared memory etc...?
- any idea to fix problem 1 and 2 mantaining all code inside apache
plugin?

Thanks

==================================================================
Valerio Ferrucci                        Tabasoft Sas
valfer@flashnet.it                      http://tabasoft.ancitel.it
                                            taba@flashnet.it


--
----------------------------------------------------------------
Apache Modules Mailing List            670 currently subscribed
----------------------------------------------------------------

If you wish to be removed from this list, send the word
'unsubscribe' to: apache-modules-request@covalent.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic