summaryrefslogtreecommitdiff
path: root/sqmail-4.3.07/man/qmail-todo.8
blob: 740f5b3403addf78f8530a6eef874fdaffd50bf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.TH s/qmail: qmail-todo 8
.SH NAME
qmail-todo \- schedule state change of message for delivery
.SH SYNOPSIS
.B qmail-todo
.SH DESCRIPTION
.B s/qmail 
with a high local and remote concurrency number 
is able to deliver a tremendous amount of messages (throughput).
Depending on the provided resources however,
often this can not be achieved since
.B qmail-send
becomes a bottleneck on delivery.

.B qmail-send 
preprocesses all new messages before deploying them for 
.I local
or for 
.I remote 
delivering. In a particulur run,
.B qmail-send 
does one 'todo' processing, but has the ability to close multiple jobs. 
Due to this layout, potentially 
.B qmail-send 
can not feed all the new available (local/remote) delivery slots 
and therefore, it is not possible to achieve the maximum throughput.

This is a minor problem, given
.B qmail-send 
is able to complete this in short time; but due to
many file system calls (fsync and (un)link) a 'todo'
run is expensive and throttles the throughput.

.B qmail-todo
solves this 'silly qmail (queue) problem'
which is apparent only on system with high injection rates,
delegating the scheduling of 'todo' runs to a dedicated process.

.SH "COMMUNICATION"
.B qmail-todo
interfaces with 
.B qmail-send
on file descriptors \fI[1,8]\fR on sending
and \fI[7,0]\fR for receiving. 
.B qmail-todo 
communicates with
.B qmail-clean
on file descriptors \fI[2,0]\fR for sending
and \fI[3,1]\fR for receiving.

.B qmail-todo 
and
.B qmail-send
share an extended and peristent message exchange format:

.EX
D[LRB]<mesgid>\0
  Start delivery for new message with id <messid>.
  The character L, R or B defines the type
  of delivery: Local, Remote, or Both, respectively.
.EE

.EX
L<string>\0
  Dump string to the logger without adding additional
 '\\n' or similar.
.EE

.B qmail-todo 
sends "\\0" terminated messages, whereas 
.B qmail-send 
just sends one character to 
.BR qmail-todo .

.SH "BIG PICTURE"
.EX
               +-------+   +-------+
               | clean |   | clean |
               +--0-1--+   +--0-1--+       +-----------+
         trigger  ^ |         ^ |        +->0,1 lspawn |
            |     | v         | v       /  +-----------+
 +-------+  v  +--2-3--+   +--5-6--+   /
 |       |  |  |       0<--7     1,2<-+ 
 | queue |--+--| todo  |   | send  | 
 |       |  |  |       1-->8     3,4<-+ 
 +-------+     +-------+   +---0---+   \\ 
                               |        \\  +-----------+
                               v         +->0,1 rspwan |
                           +---0---+       +-----------+
                           | logger|
                           +-------+
.EE

.SH "EXIT CODES"
.B qmail-todo 
exits
.I 0 
if the messages have been processed successfully.
It exits
.I 1
in case there is a communication problem with
.BR qmail-send . 
The exit code 
.I 111 
together with a diagnostic message is facilitated by
.B qmail-todo
in case it failes reading the required control files.

.SH "DIAGNOSTICS"
.B qmail-todo
provides additional diagnostic messages to
.B qmail-send
to be displayed in the logs. In particular, in
case of problems creating and (un)linking files. 

.SH "CREDITS"
.B qmail-todo
included in 
.B s/qmail
has been created by Andre Oppermann (http://www.nrg4u.com) 
as part of this LDAP patch for 
.BR qmail .
This man-page uses parts of his EXTERNAL discription.


.SH "SEE ALSO"
qmail-send(8),
qmail-queue(8).