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

List:       apache-modperl
Subject:    RE: Persistent DB connections with Apache::DBI
From:       "Ed Park " <epark () athenahealth ! com>
Date:       1999-06-30 6:16:19
[Download RAW message or body]

You should look for the bottleneck.

If you have 2GB of RAM, and your mod_perl and Oracle processes take a total
of 60MB, is your machine really thrashing (i.e., is the bottleneck memory)?
or are you dealing with a huge Oracle db-- is the bottleneck disk/memory? or
are your mod_perl scripts very large-- is the bottleneck CPU time?

You should do different things depending on the answers to these questions.

A couple of generic things you can try to keep performance up:
-Set MaxClients (in httpd.conf) to something low.
The comments on MaxClients says:
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...

However, it's something you very much want to throttle if the alternative is
thrashing.

You should also set MaxRequestsPerChild to something relatively low, because
apache/mod_perl processes tend to eat up more memory, and more non-shared
memory, over time. MaxSpareServers is another good thing to throttle down.


cheers,
Ed

> -----Original Message-----
> From: modperl-owner@apache.org [mailto:modperl-owner@apache.org]On
> Behalf Of Simon Miner
> Sent: Tuesday, June 29, 1999 2:23 PM
> To: 'Andrew Williams'
> Cc: 'modperl@apache.org'
> Subject: RE: Persistent DB connections with Apache::DBI
>
>
> I'm using Solaris 2.6.
>
> My company is heading toward having the DB on a separate machine than the
> server(s).  Probably won't happen for a couple of months, though. Can you
> suggest any other suggestions in the meantime?
>
> Thanks.
>
> > -----Original Message-----
> > From:	Andrew Williams [SMTP:awilliams@americasdoctor.com]
> > Sent:	Tuesday, June 29, 1999 5:18 PM
> > To:	Simon Miner
> > Subject:	Re: Persistent DB connections with Apache::DBI
> >
> > At 05:02 PM 6/29/99 -0400, you wrote:
> > >Hi all:
> > >
> > >Ok, after much tinkering, I've finally got Apache::DBI keeping
> persistent
> > >connections to my Oracle database.  The problem now is that
> the combined
> > >size of the mod_perl and Oracle processes (40M and 20M,
> respectively) and
> > >the high traffic on the site is bringing the machine to a crawl.
> > >
> > >Here's my layout...
> > >
> > >	Apache 1.3.3
> > >	mod_perl 1.18
> > >	DBI 1.11
> > >	DBD::Oracle 1.02
> > >	Oracle 8.0.3
> > >	2 GB RAM
> > >	4 Processors
> >
> > I would seriously consider seperating web-service from DB
> service.  A well
> > written DB (like oracle) will use all available resources on
> the machine,
> > it does this
> > because it expects that it has the machine to itself.  As soon
> as there is
> > something
> > other than the OS competing for time on the machine the DB comes to a
> > crawl.
> >
> >
> > I haven't used the persistant DB connections through mod_perl yet but we
> > ran into the
> > same problem using fastCGI java with apache and sybase.  Seperating the
> > machines
> > made all the difference in the world.
> >
> >
> > In short, production level DB servers should be seperate machines.  It
> > generally works
> > well enough on the same box to do development/testing.
> >
> > Also, what OS are you running?  There may be some tuning that
> can be done
> > (ie shared mem allocation, open file table, sbc etc.)
> >
> >
> >
> > - Andrew
>

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

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