> oh, btw, I've just released IPC::DirQueue 0.05, which includes support for
> the enqueue_sub() API as used in http://taint.org/wk/QpsmtpdIpcDirqueue .
I'm getting ~5% (whoopee!) better throughput by calling the
enqueue_string method with a full message. Tested with 11k and 50k
messages. This is with the queue living on a NFS mounted partition and
mounted locally.
11k message throughput (50k had a similar ratio):
enqueue_sub local: 5500 msg/min
enqueue_sub nfs: 2800 msg/min
enqueue_string local: 6000 msg/min
enqueue_string nfs: 2900 msg/min
Unless there is a misteak :) with the way I'm doing it.
Cheers,
ds
--- plugins/queue/ipc-dirqueue 2005-04-22 15:34:51.118437023 -0700
+++ plugins/queue/ipc-dirqueue2 2005-04-22 16:32:45.129546986 -0700
@@ -15,6 +15,7 @@
=cut
+use strict 'vars';
use IPC::DirQueue;
sub register {
@@ -40,15 +41,11 @@
my $state = 0;
$transaction->body_resetpos;
- my $ret = $self->{_dq}->enqueue_sub(sub {
- if ($state++ == 0) {
- return $transaction->header->as_string();
- } else {
- return $transaction->body_getline;
- }
- });
- $ret or
+ my $msg = $transaction->header->as_string;
+ $msg .= $transaction->body_as_string;
+
+ $self->{_dq}->enqueue_string($msg) or
$self->log(LOGWARN, "could not enqueue message: $!")
and return(DECLINED, "queue error (close)");