Postfix with PostgreSQL backend - number of connections to the database issue

2010-08-27 Thread Adam PAPAI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I use postfix with postgresql backend using pgsql_virtual_* maps.

Is it possible somehow to limit the number of the connections to the
postgresql databases? Sometimes the connection number grows up to 30-40.
And it uses persistent connection as well. I'd be happy if postfix could
use on demand postgresql connection.

It seems postfix keeps-up 8-10-15 connections always, but i guess 2 or 3
would be enough. The queries are very quick, so it's not necessary to
keep the SQL connection open.

The documentation does not mention any part of this issue.

Thanks in advance,

- -- 
Adam PAPAI
BSD Support Service
http://www.wooh.hu
E-mail: w...@wooh.hu
Phone: +36 30 33-55-735 (Hungary)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMd4rtAAoJEGq0EWvh5uiIlmwIAMf75viNa/b31TbBV1quUcPw
+wBbimnqtoieFHzvldPKyb3Ho3/JmEcThUlY2m3Hkx5L9KrOypHNpXSOVPntKGGN
WW8X0hqEI59AWMG4ckBPDh2QX1xEYnYiBd0Cxjouk8c3ZqJIu2lCsUaZ3py22GBK
ZvpajAx/rAvoNK9qd0wCTB3Dt8q+mTumP4Y3A/O2x3J0IdIQnnKGttySZYvF98qS
cXRW71ifllXNKdi+bZtFZ6DqVKKTnGqnMxgp55ghAj7au1XhCs9ZllUDlIvvlmI+
+T0f8l5rWmr3xaYHfbjUDcu3sM64qyfj0Na+lctF8n/ZEs4YRZH1D5FlH8WoIF8=
=6MMZ
-END PGP SIGNATURE-


Re: Postfix with PostgreSQL backend - number of connections to the database issue

2010-08-27 Thread Simon Waters
On Friday 27 August 2010 10:52:46 Adam PAPAI wrote:

 It seems postfix keeps-up 8-10-15 connections always, but i guess 2 or 3
 would be enough. The queries are very quick, so it's not necessary to
 keep the SQL connection open.

 The documentation does not mention any part of this issue.

Read the documentation concerning proxymap, if all tables are proxied then the 
connections should be limited by the number of proxymap processes, and all 
will be efficient.

Although Postgres shouldn't have a problem with many tens of simulateneous 
connections. 

Open connections from idle processes shouldn't be a big issue either.

The problem I have seen is under dictionary attack a box hit a limit on 
database connections before the botnet drove it into the dust on some other 
parameter. Ensuring everything used proxymap meant that it took a much bigger 
botnet to stop our email working - che sera sera.

So if the number of connections you are seeing is an issue already it might be 
worth considering how robust things might be when nasty things start 
happening (Postfix is amazingly good under such conditions I find, although 
sometimes it throws up the odd sub-optimal configuration choice - like my not 
using proxymap for all tables).



Re: Postfix with PostgreSQL backend - number of connections to the database issue

2010-08-27 Thread Adam PAPAI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/27/10 12:24 PM, Simon Waters wrote:

 Read the documentation concerning proxymap, if all tables are proxied then 
 the 
 connections should be limited by the number of proxymap processes, and all 
 will be efficient.

Proxymap will probably solve my problem.

Thanks!


- -- 
Adam PAPAI
NETIDEA Informatikai Szolgáltató Kft.
http://www.netidea.hu
E-mail: w...@wooh.hu
Phone: +36 30 33-55-735 (Hungary)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMd5yYAAoJEGq0EWvh5uiIWQ0H/3hh9XEqmrSHlY7/48bC2qFG
+R736HMF0eEfDpkeQyFqrsnnmtDxmYRP//tC0uqLIa+lE9v1ZhzWQzknDQ7Fay4A
evolvrjHX8h0IgIKpZdN0m7BBgIgSZ1/iTpY0gKh+59vMM4Mtu2qYyDzKsV9gvDl
j6jHAzw+AhuRrYYB2vyvIRY/kP5ilyxQID5HNRYeJ+A7Bneyv5qnrGDXyLamjzeu
dRjkr2bisVbEVbdZiBMv5HEwDd5GLo1EuU7EoxDzHlSNAD0yxH8CHaek8Xl40h12
uGtfu1EYeVBO9yG0OgBADMsAgUC876ULNApC56SEtwyhQNdleIkuI76nnaaKC1I=
=9vwv
-END PGP SIGNATURE-