[CDBI] Class-DBI on Apache/MS-Windows

Perrin Harkins perrin at elem.com
Mon Mar 20 20:55:42 GMT 2006


On Mon, 2006-03-20 at 22:35 +0200, Karjala wrote:
> I was wondering 1) whether anyone has gotten Class::DBI to work on
> such a setup (Apache on Win is threaded only, 1 process)

I don't know, but it should work if the database libraries and DBD are
thread-safe.

> On "2": I tried placing "use MyClass::DBI;" in a <Perl> section just
> before the virtual server's configuration, but that doesn't work (I
> get the following error

That error means you opened the connection before the threads were
spawned and two threads tried to use it.  Don't do that.

> On the other hand, when I type the "use MyClass::DBI;" statement
> inside the perl script that produces a webpage, that seems to work
> fine.

That should work.

> If I follow the second way,, will I get Class::DBI loaded 50 times
> (for the 50 active threads of Apache)?

Yes.  That's how Perl threads work.  Nothing is shared.

>  Would that be too much for a server with 512MB RAM?

Yes.  You can't just pick an arbitrary number like 50.  You need to look
at how much RAM a thread takes and then configure apache to only run as
many threads as you have room for.

(You can run fewer Perl interpreters than threads if you plan to serve
non-Perl content from the same server.)

- Perrin





More information about the ClassDBI mailing list