[Dovecot] Blocking auth services

Peter Mogensen apm at one.com
Mon Aug 15 09:44:29 EEST 2011


On 2011-08-14 22:56, Timo Sirainen wrote:
> On Mon, 2011-08-08 at 14:04 +0200, Peter Mogensen wrote:
>
>> I'm writing an passdb/userdb plugin to authenticate against an external
>> daemon listening on a UNIX socket.
>>
>> The connection to the daemon is 1 request at a time and thus blocking
>> (unlike passdb-ldap), but the daemon is preforking, so it can handle
>> more connections at a time.
>
> You're talking to it via UNIX socket, so you can talk to it with
> non-blocking sockets.

Yes... but a single connection can still only handle one request at a 
time. It's not the socket, which is blocking - it's the server end of 
the connection.

>> But I also have the option, to let the passdb/userdb plugin maintain a
>> pools of used/idle connections to the daemon and just pick a idle
>> connection and moving it to the used pool on each auth_request.
>> Which would save me the auth worker processes.
>
> This would be more efficient. (I wonder if you could make your external
> daemon talk auth-worker protocol and Dovecot would do this pooling
> automatically by thinking it's talking to its own workers?)

We actually considered replacing the entire dovecot-auth process with a 
re-write of the daemon, which we had done with courier. But the 
courier-auth process is simpler, so we decided to go for a plugin to 
dovecot-auth.

/Peter


More information about the dovecot mailing list