PostgreSQL backend: a waste of time?

Nicola Ranaldo ranaldo at unina.it
Fri Nov 29 03:36:13 EST 2002


I cannot spread sql commands of a unique transaction over multiple pgsql
connection, and a connection cannot handle parallel transactions.
So if i have 1000 imapd process starting a transaction the mailbox daemon
has to open 1000 pgsql connection.
One solution could be:
BEGIN -> Allocate a new buffer to store sql commands
SQL COMMANDS -> add commands to buffer
COMMIT -> send all the buffered commands to the mailbox daemon and cleanup
the buffer
ABORT -> cleanup the buffer
Do you think this is a good solution ?
Howewer i think a pgsql connection for every master child could not be a
problem, on my production server (7500 very active users, cyrus.log is
20MB/day) the average number of imapd is 15, pop3d is 30, lmtpd is 5 (under
mail-bombing lmtpd process was 45). Howewer it is an AlphaServer ES45 with 4
1ghz CPU and 700Gb of raid disk and is quite fast. Wath's your experience
with huge number of users or slow server ?

Bye

    Nicola Ranaldo

> IIRC someone implemented such a daemon and patched cyrus to use it. This
> daemon's backend was a text-file but the "protocol" is there.
>
> a drawing :)
>
> imapd1   imapd2   imapd3 ... imap1000
>    |        |        |           |
>    -------------------------------
>             |
>           daemon
>             |
> -----------------------
> |  |   |   |   |   |  |
> 1  2   3   4   5   6  7
>
> 1 to 7 would be postgresql connections. This number may vary... maybe 1
> connection per 100 imapds? Or a user defined number. IMMV...







More information about the Info-cyrus mailing list