~ubuntu-branches/ubuntu/trusty/postfix/trusty-updates

« back to all changes in this revision

Viewing changes to proto/STRESS_README.html

  • Committer: Package Import Robot
  • Author(s): LaMont Jones, LaMont Jones, localization folks
  • Date: 2014-02-11 07:44:30 UTC
  • mfrom: (58.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140211074430-kwkoxdz0fbajn0fj
Tags: 2.11.0-1
[LaMont Jones]

* New upstream release: 2.11.0

[localization folks]

* l10n: Updated German translations.  Closes: #734893 (Helge Kreutzmann)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
<li><a href="#overload"> Symptoms of Postfix SMTP server overload </a> 
35
35
 
 
36
<li><a href="#adapt"> Automatic stress-adaptive behavior </a>
 
37
 
36
38
<li><a href="#concurrency"> Service more SMTP clients at the same time </a> 
37
39
 
38
40
<li><a href="#time"> Spend less time per SMTP client </a>
41
43
 
42
44
<li><a href="#legacy"> Temporary measures for older Postfix releases </a>
43
45
 
44
 
<li><a href="#adapt"> Automatic stress-adaptive behavior </a>
45
 
 
46
46
<li><a href="#feature"> Detecting support for stress-adaptive behavior </a>
47
47
 
48
48
<li><a href="#forcing"> Forcing stress-adaptive behavior on or off </a>
109
109
Oct  3 20:39:27 spike postfix/master[28905]: warning: to avoid this
110
110
 condition, increase the process count in master.cf or reduce the
111
111
 service time per client
 
112
Oct  3 20:39:27 spike postfix/master[28905]: warning: see
 
113
  <a href="http://www.postfix.org/STRESS_README.html">http://www.postfix.org/STRESS_README.html</a> for examples of
 
114
  stress-adapting configuration settings
112
115
</pre>
113
116
 
114
117
</ul>
118
121
still arrive once the situation returns to normal, as long as the
119
122
overload condition is temporary.  </p>
120
123
 
 
124
<h2><a name="adapt"> Automatic stress-adaptive behavior </a></h2>
 
125
 
 
126
<p> Postfix version 2.5 introduces automatic stress-adaptive behavior.
 
127
It works as follows. When a "public" network service such as the
 
128
SMTP server runs into an "all server ports are busy" condition, the
 
129
Postfix master(8) daemon logs a warning, restarts the service
 
130
(without interrupting existing network sessions), and runs the
 
131
service with "-o stress=yes" on the server process command line:
 
132
</p>
 
133
 
 
134
<blockquote>
 
135
<pre>
 
136
80821  ??  S      0:00.24 smtpd -n smtp -t inet -u -c -o stress=yes
 
137
</pre>
 
138
</blockquote>
 
139
 
 
140
<p> Normally, the Postfix master(8) daemon runs such a service with
 
141
"-o stress=" on the command line (i.e.  with an empty parameter
 
142
value):  </p>
 
143
 
 
144
<blockquote>
 
145
<pre>
 
146
83326  ??  S      0:00.28 smtpd -n smtp -t inet -u -c -o stress=
 
147
</pre>
 
148
</blockquote>
 
149
 
 
150
<p> Services that have local access only never have "-o stress"
 
151
parameters on the command line. This includes services internal to
 
152
Postfix such as the queue manager, and services that listen on a
 
153
loopback interface only, such as after-filter SMTP services.  </p>
 
154
 
 
155
<p> The "stress" parameter value is the key to making main.cf
 
156
parameter settings stress adaptive. The following settings are the
 
157
default with Postfix 2.6 and later. </p>
 
158
 
 
159
<blockquote>
 
160
<pre>
 
161
1 smtpd_timeout = ${stress?10}${stress:300}s
 
162
2 smtpd_hard_error_limit = ${stress?1}${stress:20}
 
163
3 smtpd_junk_command_limit = ${stress?1}${stress:100}
 
164
4 # Parameters added after Postfix 2.6:
 
165
5 smtpd_per_record_deadline = ${stress?yes}${stress:no}
 
166
6 smtpd_starttls_timeout = ${stress?10}${stress:300}s
 
167
7 address_verify_poll_count = ${stress?1}${stress:3}
 
168
</pre>
 
169
</blockquote>
 
170
 
 
171
<p> Translation: <p>
 
172
 
 
173
<ul>
 
174
 
 
175
<li> <p> Line 1: under conditions of stress, use an smtpd_timeout
 
176
value of 10 seconds instead of the default 300 seconds. Experience
 
177
on the postfix-users list from a variety of sysadmins shows that
 
178
reducing the "normal" smtpd_timeout to 60s is unlikely to affect
 
179
legitimate clients. However, it is unlikely to become the Postfix
 
180
default because it's not RFC compliant. Setting smtpd_timeout to
 
181
10s or even 5s under stress will still allow most
 
182
legitimate clients to connect and send mail, but may delay mail
 
183
from some clients. No mail should be lost, as long as this measure
 
184
is used only temporarily. </p>
 
185
 
 
186
<li> <p> Line 2: under conditions of stress, use an smtpd_hard_error_limit
 
187
of 1 instead of the default 20. This helps by disconnecting clients
 
188
after a single error, giving other clients a chance to connect.
 
189
However, this may cause significant delays with legitimate mail,
 
190
such as a mailing list that contains a few no-longer-active user
 
191
names that didn't bother to unsubscribe. No mail should be lost,
 
192
as long as this measure is used only temporarily. </p>
 
193
 
 
194
<li> <p> Line 3: under conditions of stress, use an
 
195
smtpd_junk_command_limit of 1 instead of the default 100. This
 
196
prevents clients from keeping connections open by repeatedly
 
197
sending HELO, EHLO, NOOP, RSET, VRFY or ETRN commands. </p>
 
198
 
 
199
<li> <p> Line 5: under conditions of stress, change the behavior
 
200
of smtpd_timeout and smtpd_starttls_timeout, from a time limit per
 
201
read or write system call, to a time limit to send or receive a
 
202
complete record (an SMTP command line, SMTP response line, SMTP
 
203
message content line, or TLS protocol message). </p>
 
204
 
 
205
<li> <p> Line 6: under conditions of stress, reduce the time limit
 
206
for TLS protocol handshake messages to 10 seconds, from the default
 
207
value of 300 seconds. See also the smtpd_timeout discussion above.
 
208
</p>
 
209
 
 
210
<li> <p> Line 7: under conditions of stress, do not wait up to 6
 
211
seconds for the completion of an address verification probe. If the
 
212
result is not already in the address verification cache, reply
 
213
immediately with $unverified_recipient_tempfail_action or
 
214
$unverified_sender_tempfail_action. No mail should be lost, as long
 
215
as this measure is used only temporarily.  </p>
 
216
 
 
217
</ul>
 
218
 
 
219
<p> The syntax of ${name?value} and ${name:value} is explained at
 
220
the beginning of the postconf(5) manual page. </p>
 
221
 
 
222
<p> NOTE: Please keep in mind that the stress-adaptive feature is
 
223
a fairly desperate measure to keep <b>some</b> legitimate mail
 
224
flowing under overload conditions.  If a site is reaching the SMTP
 
225
server process limit when there isn't an attack or bot flood
 
226
occurring, then either the process limit needs to be raised or more
 
227
hardware needs to be added.  </p>
 
228
 
121
229
<h2><a name="concurrency"> Service more SMTP clients at the same time </a> </h2>
122
230
 
 
231
<p> This section and the ones that follow discuss permanent measures
 
232
against mail server overload.  </p>
 
233
 
123
234
<p> One measure to avoid the "all server processes busy" condition
124
235
is to service more SMTP clients simultaneously. For this you need
125
236
to increase the number of Postfix SMTP server processes. This will
349
460
as these measures are used only temporarily. The next section of
350
461
this document introduces a way to automate this process. </p>
351
462
 
352
 
<h2><a name="adapt"> Automatic stress-adaptive behavior </a></h2>
353
 
 
354
 
<p> Postfix version 2.5 introduces automatic stress-adaptive behavior.
355
 
This is also available as a source code patch for Postfix versions
356
 
2.4 and 2.3 from the mirrors listed at
357
 
http://www.postfix.org/download.html.  </p>
358
 
 
359
 
<p> It works as follows. When a "public" network service such as
360
 
the SMTP server runs into an "all server ports are busy" condition,
361
 
the Postfix master(8) daemon logs a warning, restarts the service
362
 
(without interrupting existing network sessions), and runs the
363
 
service with "-o stress=yes" on the server process command line:
364
 
</p>
365
 
 
366
 
<blockquote>
367
 
<pre>
368
 
80821  ??  S      0:00.24 smtpd -n smtp -t inet -u -c -o stress=yes
369
 
</pre>
370
 
</blockquote>
371
 
 
372
 
<p> Normally, the Postfix master(8) daemon runs such a service with
373
 
"-o stress=" on the command line (i.e.  with an empty parameter
374
 
value):  </p>
375
 
 
376
 
<blockquote>
377
 
<pre>
378
 
83326  ??  S      0:00.28 smtpd -n smtp -t inet -u -c -o stress=
379
 
</pre>
380
 
</blockquote>
381
 
 
382
 
<p> Services that have local access only never have "-o stress"
383
 
parameters on the command line. This includes services internal to
384
 
Postfix such as the queue manager, and services that listen on a
385
 
loopback interface only, such as after-filter SMTP services.  </p>
386
 
 
387
 
<p> The "stress" parameter value is the key to making main.cf
388
 
parameter settings stress adaptive. The following settings are the
389
 
default with Postfix 2.6 and later. With earlier Postfix versions
390
 
that have stress-adaptive support, append the lines below to the
391
 
main.cf file and issue a "postfix reload" command: </p>
392
 
 
393
 
<blockquote>
394
 
<pre>
395
 
1 smtpd_timeout = ${stress?10}${stress:300}s
396
 
2 smtpd_hard_error_limit = ${stress?1}${stress:20}
397
 
3 smtpd_junk_command_limit = ${stress?1}${stress:100}
398
 
</pre>
399
 
</blockquote>
400
 
 
401
 
<p> Translation: <p>
402
 
 
403
 
<ul>
404
 
 
405
 
<li> <p> Line 1: under conditions of stress, use an smtpd_timeout
406
 
value of 10 seconds instead of the default 300 seconds. Experience
407
 
on the postfix-users list from a variety of sysadmins shows that
408
 
reducing the "normal" smtpd_timeout to 60s is unlikely to affect
409
 
legitimate clients. However, it is unlikely to become the Postfix
410
 
default because it's not RFC compliant. Setting smtpd_timeout to
411
 
10s (line 2 below) or even 5s under stress will still allow most
412
 
legitimate clients to connect and send mail, but may delay mail
413
 
from some clients. No mail should be lost, as long as this measure
414
 
is used only temporarily. </p>
415
 
 
416
 
<li> <p> Line 2: under conditions of stress, use an smtpd_hard_error_limit
417
 
of 1 instead of the default 20. This helps by disconnecting clients
418
 
after a single error, giving other clients a chance to connect.
419
 
However, this may cause significant delays with legitimate mail,
420
 
such as a mailing list that contains a few no-longer-active user
421
 
names that didn't bother to unsubscribe. No mail should be lost,
422
 
as long as this measure is used only temporarily. </p>
423
 
 
424
 
<li> <p> Line 3: under conditions of stress, use an
425
 
smtpd_junk_command_limit of 1 instead of the default 100. This
426
 
prevents clients from keeping idle connections open by repeatedly
427
 
sending NOOP or RSET commands. </p>
428
 
 
429
 
</ul>
430
 
 
431
 
<p> The syntax of ${name?value} and ${name:value} is explained at
432
 
the beginning of the postconf(5) manual page. </p>
433
 
 
434
 
<p> NOTE: Please keep in mind that the stress-adaptive feature is
435
 
a fairly desperate measure to keep <b>some</b> legitimate mail
436
 
flowing under overload conditions.  If a site is reaching the SMTP
437
 
server process limit when there isn't an attack or bot flood
438
 
occurring, then either the process limit needs to be raised or more
439
 
hardware needs to be added.  </p>
440
 
 
441
463
<h2><a name="feature"> Detecting support for stress-adaptive behavior </a></h2>
442
464
 
443
465
<p> To find out if your Postfix installation supports stress-adaptive