Re: DBI and threaded MPM

2007-07-11 Thread Foo JH

Anthony Gardner wrote:
Perrin, I never received your mail (actually, I hardly receive any 
mails form this list) I have to go to the archives to see if I've 
received any replies or to see what's been posted in general!!
You may want to check with your email admin on this. There's posting on 
this list almost daily!




Re: DBI and threaded MPM

2007-07-11 Thread Perrin Harkins

On 7/11/07, Anthony Gardner [EMAIL PROTECTED] wrote:

A. We recently went live with a DB application and the system ground
to a halt. It could be due to many things, but the thing I'm looking at
is the fact that we had many network connections. I then found the
info about  Databases and threaded MPM. From what I understand,
DB connections created at server startup are not shared amongst
threads.


That's correct.  Each process or thread must have a separate connection.

Before you can fix your problem, you need to find out what the problem
is.  It sounds like you haven't done much configuration, so the most
likely problem is that you have MaxClients set really high and you are
using up all the memory on the machine and going into swap.  There's
lots of advice on the mod_perl site about how to correctly tune
MaxClients and related settings.

- Perrin


DBI and threaded MPM

2007-07-09 Thread Anthony Gardner
http://perl.apache.org/docs/2.0/user/performance/mpm.html#Work_with_DataBases_under_Threaded_MPM

I'm looking into a problem we're experiencing (lots of netword connections) and 
I think the answer lies with Apache::DBI and the version of mod_perl we're 
using.

A few questions, does anyone know of the state of DBI::Pool?

If anyone is using threaded MPM and Apache::DBI, how are they dealing with 
sharing the the connection within the threads?

I'm looking at Thread::Sociable (preference) and threads::shared and 

I'm looking for tips and/or defacto stds used at the time of writing.
Any tips would be great while I continue playing with threads and searching for 
other info.

CIA

-Ants

   
-
 Yahoo! Answers - Get better answers from someone who knows. Tryit now.

Re: DBI and threaded MPM

2007-07-09 Thread Jonathan Vanasco


On Jul 9, 2007, at 9:12 AM, Anthony Gardner wrote:

http://perl.apache.org/docs/2.0/user/performance/ 
mpm.html#Work_with_DataBases_under_Threaded_MPM


I'm looking into a problem we're experiencing (lots of netword  
connections) and I think the answer lies with Apache::DBI and the  
version of mod_perl we're using.


A few questions, does anyone know of the state of DBI::Pool?

If anyone is using threaded MPM and Apache::DBI, how are they  
dealing with sharing the the connection within the threads?


I'm looking at Thread::Sociable (preference) and threads::shared and

I'm looking for tips and/or defacto stds used at the time of writing.
Any tips would be great while I continue playing with threads and  
searching for other info.


Some people here ( not including me though ) are using connect_cached  
in DBI , and bypassing Apache::DBI altogether.  you might want to try  
that.
correct me if i'm wrong.. but i believe you want to not share dbi  
connections between threads.  wouldn't you need a factory class to  
toss you a fresh connect ?
if you want to do true connection pooling, you'd be best off with  
something like sqlrelay or pgpool.  the apache::dbi/dbi cached don't  
really pool; they just override connects for established connections  
on their process and reuse them.  things like sqlrelay/pgpool will  
let you use 50 db connections for 150 server processes ( by blocking  
a lot, yes )





// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|   CEO/Founder SyndiClick Networks
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

| Founder/CTO/CVO
|  FindMeOn.com - The cure for Multiple Web Personality Disorder
|  Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -

|  RoadSound.com - Tools For Bands, Stuff For Fans
|  Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -





Re: DBI and threaded MPM

2007-07-09 Thread Perrin Harkins

On 7/9/07, Anthony Gardner [EMAIL PROTECTED] wrote:

I'm looking into a problem we're experiencing (lots of netword connections)
and I think the answer lies with Apache::DBI and the version of mod_perl
we're using.


Can you explain a little more about what the problem is and why you
think it involves Apache::DBI?


A few questions, does anyone know of the state of DBI::Pool?


There is no working version of it, but Stas did write some code which
someone else could pick up if they were interested.


If anyone is using threaded MPM and Apache::DBI, how are they dealing with
sharing the the connection within the threads?


No one is doing that.  It is not possible without doing some work on
every DBD module that is going to be supported.


I'm looking at Thread::Sociable (preference) and threads::shared and


They won't work because DBD modules carry around XS structures which
don't know anything about perl threads.  That's the problem DBI::Pool
was trying to address.

May I ask why you're using a threaded MPM?  Unless you're running on
Windows, you should probably avoid it.  The threaded MPM uses a lot
more memory than the prefork one.

- Perrin