logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2.4.5/prefork mod_dbd -> to many db connections
Author
marlan



Joined: 24 May 2020
Posts: 2

PostPosted: Sun 24 May '20 10:33    Post subject: Apache 2.4.5/prefork mod_dbd -> to many db connections Reply with quote

Hi,
I have a problem with mod_dbd.
For a rewritemap I have configured a database connection:
Code:

DBDriver  pgsql
DBDParams "hostaddr=127.0.0.1 port=5432 dbname=dbname user=dbuser password=dbpassword"
DBDMin      1
DBDKeep     2
DBDMax     10
DBDExptime 60
#https://httpd.apache.org/docs/2.4/mod/mod_dbd.html


If I understand the dbd documentation correctly, with the mpm prefork module, the apache is not threaded and mod_db is using a single persistent connection per process (and not a database pool and the param like DBDMin etc. have no effect). If I activate the configuration, the server quickly reached the limit of db connections. In the pgadmin dashboard I can see at least 100 apache-postgres Connections in the state idle. Can someone tell me how i can calculate the maximal connections the apache will open? What does per process mean? Is that the MaxClients value?
Thanks mark
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 08 Jun '20 12:43    Post subject: Reply with quote

Hi Mark,

if you set DBDPersist Off the connections will be closed and you shouldn't have so many idle connections.

The default no matter of the the mpm module is DBDPersist On

DBDMin, DBDKeep, DBDMax, and DBDExptime are only on threaded mpm's
Back to top
marlan



Joined: 24 May 2020
Posts: 2

PostPosted: Mon 08 Jun '20 13:13    Post subject: Reply with quote

But this should't been used on an production system.
Quote:
If set to Off, persistent and pooled connections are disabled. A new database connection is opened when requested by a client, and closed immediately on release. This option is for debugging and low-usage servers.

The default is to enable a pool of persistent connections (or a single LAMP-style persistent connection in the case of a non-threaded server), and should almost always be used in operation.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 08 Jun '20 15:19    Post subject: Reply with quote

I've read that, too. But I would give it a trial, since the you reach the limit.
Well you could use a different mpm
Back to top


Reply to topic   Topic: Apache 2.4.5/prefork mod_dbd -> to many db connections View previous topic :: View next topic
Post new topic   Forum Index -> Apache