> > If it was running under CGI, it would be compiling CGI.pm on each
request,
> > which I've seen take .3 seconds.  Taking that long just to create the
new
> > CGI instance seems unusual.  How did you time it?  Are you using
> > Apache::DProf?
> >
>
> Wouldnt it be compiled at the use-statement ?

Yes, but when running under CGI (the protocol, not the module) that use
statement is executed every time.

> I timed it using
> module-internal loggingfunction which use time::hires.

That's usually pretty accurate, so I guess it really takes that long on your
system.  Try Apache::Request!  Or even one of the lighter CGI modules like
CGI_Lite.

> in my case it means up to 4 connections per process, cause in fact it
> is not one module but 2 (input and output) and each needs to handle 2
different
> connections.

If you could reduce that, it would certainly help your application's
performance.

> I hope to share databasehandles via IPC. One has to avoid that only
> one process writes to a handle at the same time !!

IPC::Shareable, and most of the other options, use Storable to serialize
data structures.  Storable can't serialize an open socket.  You *CAN* share
sockets, but you'd have to write some custom C code to do it.  You might
look at the Sybase thing that was posted here recently.  (I haven't looked
at it yet, but it sounded interesting.)

> if max. number is
> reached - return 0. The calling application can then decide to print
> an excuse due to the user 'cause we are so popular we cant server you
> :)' or create and destroy a temporary handle to process the request.

Even with temporary handles, you have the possibility of all servers being
busy at once and thus using all 4 handles.

> This would be something I would actually prefer to Apache::DBI, but I
> dont know if its possible, but I'll try.  Such a thing would be very
> important, especially on slow servers with less ram, where Apache::DBI
> opens to many connections in peak-times and leaves the system in a bad
> condition ('to many open filehandles')

I still think you'd be better off just limiting the total number of servers
with MaxClients.  Put a reverse proxy in front and you'll offload all the
work that doesn't require a database handle.

> ps: just if one is interested: today I was very happy to wear a helmet
> when I crashed with my bike ;)

I guess my mother was right about that.  Keep your helmet on!

Glad you're not dead,
Perrin

Reply via email to