On 2006-08-09 19:02:42 +0100, Robin Bowes wrote: > Emmanuel Lacour wrote: > > > If it is possible to keep this connection for more than one message, > > this would be great :) But I really can't see how to do that :( > > I ran into a similar issue with MySQL connections. > > The trouble is that there are several instances of qpsmtpd so any > persistent connection would have to be at a higher level (application?) > and I suppose then you'd run into contention issues when >1 instance > tries to use the same connection (LDAP or MySQL). > > Some sort of pool of connections (like apache DB connections) would be a > nice feature.
That depends a lot on the way you use qpsmtpd. For the apache module or
pollserver, a connection pool should be possible and is probably useful.
For qpsmtpd-forkserver, you can have one database connection per SMTP
connection (which may be several messages, but is usually only one
message). While you can open a database connection in the pre-connection
hook, many database protocols aren't designed to be used that way and
either won't work at all or produce subtle bugs. If setting up a
connection is really a performance bottleneck, you could start a
middle-tier "proxy server" in the pre-connection hook and use some
lightweight protocol to talk with that. I'd be wary of the added
complexity, though.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | [EMAIL PROTECTED] | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
pgpGs0SgdmFi5.pgp
Description: PGP signature
