xref: /netbsd-src/external/ibm-public/postfix/dist/proto/TUNING_README.html (revision 501cd18a74d52bfcca7d9e7e3b0d472bbc870558)
1<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
2        "http://www.w3.org/TR/html4/loose.dtd">
3
4<html>
5
6<head>
7
8<title>Postfix Performance Tuning</title>
9
10<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
11
12</head>
13
14<body>
15
16<h1><img src="postfix-logo.jpg" width="203" height="98" alt="">
17Postfix Performance Tuning</h1>
18
19<hr>
20
21<h2>Purpose of Postfix performance tuning </h2>
22
23<p> The hints and tips in this document help you improve the
24performance of Postfix systems that already work.  If your Postfix
25system is unable to receive or deliver mail, then you need to solve
26those problems first, using the DEBUG_README document as guidance.
27
28<p> For tuning external content filter performance, first read the
29respective information in the FILTER_README and SMTPD_PROXY_README
30documents. Then make sure to avoid latency in the content filter
31code. As much as possible avoid performing queries against external
32data sources with a high or highly variable delay. Your content
33filter will run with a small concurrency to avoid CPU/memory
34starvation, and if any latency creeps in, content filter throughput
35will suffer. High volume environments should avoid RBL lookups,
36complex database queries and so on. </p>
37
38<p>Topics on mail receiving performance: </p>
39
40<ul>
41
42<li> <a href="#server_tips">General mail receiving performance tips</a>
43
44<li> <a href="#speedup">Doing more work with your SMTP server processes</a>
45
46<li> <a href="#slowdown">Slowing down SMTP clients that make many errors</a>
47
48<li> <a href="#conn_limit">Measures against clients that make too many connections</a>
49
50</ul>
51
52<p>Topics on mail delivery performance: </p>
53
54<ul>
55
56<li> <a href="#mailing_tips">General mail delivery performance tips</a>
57
58<li> <a href="#hammer">Tuning the frequency of deferred mail delivery attempts</a>
59
60<li> <a href="#rope">Tuning the number of simultaneous deliveries</a>
61
62<li> <a href="#rcpts">Tuning the number of recipients per delivery</a>
63
64</ul>
65
66<p>Other Postfix performance tuning topics:  </p>
67
68<ul>
69
70<li> <a href="#proc_limit">Tuning the number of Postfix processes</a>
71
72<li> <a href="#proc_sys">Tuning the number of processes on the system</a>
73
74<li> <a href="#file_limit">Tuning the number of open files or
75sockets</a>
76
77</ul>
78
79<p> The following tools can be used to measure mail system performance
80under artificial loads. They are normally not installed with Postfix.
81</p>
82
83<ul>
84
85<li> <a href="smtp-source.1.html">smtp-source, SMTP/LMTP message
86generator</a>
87
88<li> <a href="smtp-sink.1.html">smtp-sink, SMTP/LMTP message dump
89</a>
90
91<li> <a href="qmqp-source.1.html">qmqp-source, QMQP message generator
92</a>
93
94<li> <a href="qmqp-sink.1.html">qmqp-sink, QMQP message dump </a>
95
96</ul>
97
98<h2><a name="server_tips">General mail receiving performance
99tips</a></h2>
100
101<ul>
102
103<li> <p> Read and understand the maildrop queue, incoming queue,
104and active queue discussions in the QSHAPE_README document. </p>
105
106<li> <p> Run a local name server to reduce slow-down due to DNS
107lookups. If you run multiple Postfix systems, point each local name
108server to a shared forwarding server to reduce the number of lookups
109across the upstream network link. </p>
110
111<li> <p> Eliminate unnecessary LDAP lookups, by specifying a domain
112filter. This eliminates lookups for addresses in remote domains,
113and eliminates lookups of partial addresses.  See ldap_table(5) for
114details. </p>
115
116</ul>
117
118<p> When Postfix responds slowly to SMTP clients: </p>
119
120<ul>
121
122<li> <p> <a href="DEBUG_README.html#logging">Look for obvious signs
123of trouble</a> as described in the DEBUG_README document, and
124eliminate those problems first. </p>
125
126<li> <p> Turn off your header_checks and body_checks patterns and
127see if the problem goes away. </p>
128
129<li> <p> <a href="DEBUG_README.html#no_chroot">Turn off chroot
130operation</a> as described in the DEBUG_README document and see
131if the problem goes away. </p>
132
133<li> <p> If Postfix logs the SMTP client as "unknown" then you have
134a name service problem: the name server is bad, or the resolv.conf
135file contains bad information, or some packet filter is blocking
136the DNS requests or replies.  </p>
137
138<li> <p> If the number of smtpd(8) processes has reached the process
139limit as specified in master.cf, new SMTP clients must wait until
140a process becomes available.  See the STRESS_README and POSTSCREEN_README
141documents for measures that help to prevent SMTP server overload.  </p>
142
143</ul>
144
145<h2><a name="speedup">Doing more work with your SMTP server
146processes</a></h2>
147
148<p> With Postfix versions 2.0 and earlier, the smtpd(8) server
149pauses before reporting an error to an SMTP client. The idea is
150called tar pitting.  However, these delays also slow down Postfix.
151When the smtpd(8) server replies slowly, sessions take more time,
152so that more smtpd(8) server processes are needed to handle the
153load. When your Postfix smtpd(8) server process limit is reached,
154new clients must wait until a server process becomes available.
155This means that all clients experience poor performance.  </p>
156
157<p> You can speed up the handling of smtpd(8) server error replies
158by turning off the delay: </p>
159
160<blockquote>
161<pre>
162/etc/postfix/main.cf:
163    # Not needed with Postfix 2.1
164    smtpd_error_sleep_time = 0
165</pre>
166</blockquote>
167
168<p> With the above setting, Postfix 2.0 and earlier can serve more
169SMTP clients with the same number SMTP server processes. The next
170section describes how Postfix deals with clients that make a large
171number of errors.  </p>
172
173<h2><a name="slowdown"> Slowing down SMTP clients that make many errors</a></h2>
174
175<p> The Postfix smtpd(8) server maintains a per-session error count.
176The error count is reset when a message is transferred successfully,
177and is incremented when a client request is unrecognized or
178unimplemented, when a client request violates <a
179href="SMTPD_ACCESS_README.html">access restrictions</a>, or when
180some other error happens.  </p>
181
182<p> As the per-session error count increases, the smtpd(8) server
183changes behavior and begins to insert delays into the responses.
184The idea is to slow down a run-away client in order to limit resource
185usage.  The behavior is Postfix version dependent. </p>
186
187<p> IMPORTANT: These delays slow down Postfix, too. When too much
188delay is configured, the number of simultaneous SMTP sessions will
189increase until it reaches the smtpd(8) server process limit, and new
190SMTP clients must wait until an smtpd(8) server process becomes available.
191</p>
192
193<p> Postfix version 2.1 and later:</p>
194
195<ul>
196
197<li> <p> When the error count reaches $smtpd_soft_error_limit
198(default: 10), the Postfix smtpd(8) server delays all non-error and
199error responses by $smtpd_error_sleep_time seconds (default: 1
200second).  </p>
201
202<li><p>When the error count reaches $smtpd_hard_error_limit
203(default: 20) the Postfix smtpd(8) server breaks the connection. </p>
204
205</ul>
206
207<p> Postfix version 2.0 and earlier:</p>
208
209<ul>
210
211<li> <p> When the error count is less than $smtpd_soft_error_limit
212(default: 10) the Postfix smtpd(8) server delays all error replies by
213$smtpd_error_sleep_time (1 second with Postfix 2.0, 5 seconds with
214Postfix 1.1 and earlier). </p>
215
216<li> <p> When the error count reaches $smtpd_soft_error_limit,
217the Postfix smtpd(8) server delays all responses by "error count"
218seconds or $smtpd_error_sleep_time, whichever is more.  </p>
219
220<li><p>When the error count reaches $smtpd_hard_error_limit
221(default: 20) the Postfix smtpd(8) server breaks the connection. </p>
222
223</ul>
224
225<h2><a name="conn_limit">Measures against clients that make too many connections</a></h2>
226
227<p> Note: these features use the Postfix anvil(8) service, introduced
228with Postfix version 2.2. </p>
229
230<p> The Postfix smtpd(8) server can limit the number of simultaneous
231connections from the same SMTP client, as well as the connection
232rate and the rate of certain SMTP commands from the same client.
233These statistics are maintained by the anvil(8) server (translation:
234if anvil(8) breaks, then connection limits stop working). </p>
235
236<p> IMPORTANT: These limits must not be used to regulate legitimate
237traffic: mail will suffer grotesque delays if you do so.  The limits
238are designed to protect the smtpd(8) server against abuse by
239out-of-control clients.  </p>
240
241<blockquote>
242
243<dl>
244
245<dt> smtpd_client_connection_count_limit (default: 50) </dt> <dd>
246The maximum number of connections that an SMTP client may make
247simultaneously. </dd>
248
249<dt> smtpd_client_connection_rate_limit (default: no limit) </dt>
250<dd> The maximum number of connections that an SMTP client may make
251in the time interval specified with anvil_rate_time_unit (default:
25260s).  </dd>
253
254<dt> smtpd_client_message_rate_limit (default: no limit) </dt> <dd>
255The maximum number of message delivery requests that an SMTP client
256may make in the time interval specified with anvil_rate_time_unit
257(default: 60s). </dd>
258
259<dt> smtpd_client_recipient_rate_limit (default: no limit) </dt>
260<dd> The maximum number of recipient addresses that an SMTP client
261may specify in the time interval specified with anvil_rate_time_unit
262(default: 60s). </dd>
263
264<dt> smtpd_client_new_tls_session_rate_limit (default: no limit)
265</dt> <dd> The maximum number of new TLS sessions (without using
266the TLS session cache) that an SMTP client may negotiate in the
267time interval specified with anvil_rate_time_unit (default: 60s).
268</dd>
269
270<dt> smtpd_client_event_limit_exceptions (default: $mynetworks)
271</dt> <dd> SMTP clients that are excluded from connection and rate
272limits specified above. </dd>
273
274</dl>
275
276</blockquote>
277
278<h2><a name="mailing_tips">General mail delivery performance tips</a></h2>
279
280<ul>
281
282<li> <p> Read and understand the maildrop queue, incoming queue,
283active queue and deferred queue discussions in the QSHAPE_README
284document. </p>
285
286<li> <p> In case of slow delivery, run the qshape tool as described
287in the QSHAPE_README document. </p>
288
289<li> <p> Submit multiple recipients per message instead of submitting
290messages with only a few recipients. </p>
291
292<li> <p> Submit mail via SMTP instead of /usr/sbin/sendmail.  You
293may have to adjust the smtpd_recipient_limit parameter setting.
294</p>
295
296<li> <p> Don't overwhelm the disk with mail submissions.  Optimize
297the mail submission rate by tuning the number of parallel submissions
298and/or by tuning the Postfix in_flow_delay parameter setting.  </p>
299
300<li> <p> Run a local name server to reduce slow-down due to DNS
301lookups. If you run multiple Postfix systems, point each local name
302server to a shared forwarding server to reduce the number of lookups
303across the upstream network link. </p>
304
305<li> <p> Reduce the smtp_connect_timeout and smtp_helo_timeout
306values so that Postfix does not waste lots of time connecting
307to non-responding remote SMTP servers. </p>
308
309<li> <p> Use a dedicated mail delivery transport for problematic
310destinations, with reduced timeouts and with adjusted concurrency.
311See "<a href="#rope">Tuning the number of simultaneous deliveries</a>"
312below.
313</p>
314
315<li> <p> Use a fallback_relay host for mail that cannot be delivered
316upon the first attempt. This "graveyard" machine can use shorter
317retry times for difficult to reach destinations. See "<a
318href="#hammer">Tuning the frequency of deferred mail delivery
319attempts</a>" below. </p>
320
321<li> <p> Speed up disk updates with a large (64MB) persistent write
322cache. This allows disk updates to be sorted for optimal access
323speed without compromising file system integrity when the system
324crashes. </p>
325
326<li> <p> Use a solid-state disk (a persistent RAM disk). This
327is an expensive solution that should be used in combination
328with short SMTP timeouts and a fallback_relay "graveyard"
329machine that delivers mail for problem destinations.  </p>
330
331</ul>
332
333<h2><a name="rope">Tuning the number of simultaneous deliveries</a></h2>
334
335<p> Although Postfix can be configured to run 1000 SMTP client
336processes at the same time, it is rarely desirable that it makes
3371000 simultaneous connections to the same remote system. For this
338reason, Postfix has safety mechanisms in place to avoid this
339so-called "thundering herd" problem. </p>
340
341<p> The Postfix queue manager implements the analog of the TCP slow
342start flow control strategy: when delivering to a site, send a
343small number of messages first, then increase the concurrency as
344long as all goes well; reduce concurrency in the face of congestion.
345</p>
346
347<ul>
348
349<li> <p> The initial_destination_concurrency parameter (default: 5)
350controls how many messages are initially sent to the same destination
351before adapting delivery concurrency. Of course, this setting is
352effective only as long as it does not exceed the process limit and
353the destination concurrency limit for the specific mail transport
354channel. </p>
355
356<li> <p> The default_destination_concurrency_limit parameter (default:
35720) controls how many messages may be sent to the same destination
358simultaneously. You can override this setting for specific message
359delivery transports by taking the name of the master.cf entry
360and appending "_destination_concurrency_limit". </p>
361
362</ul>
363
364<p> Examples of transport specific concurrency limits are: </p>
365
366<ul>
367
368<li> <p> The local_destination_concurrency_limit parameter (default:
3692) controls how many messages are delivered simultaneously to the
370same local recipient. The recommended limit is low because delivery
371to the same mailbox must happen sequentially, so massive parallelism
372is not useful. Another good reason to limit delivery concurrency
373to the same recipient: if the recipient has an expensive shell
374command in her .forward file, or if the recipient is a mailing list
375manager, you don't want to run too many instances of those processes
376at the same time.  </p>
377
378<li> <p> The default smtp_destination_concurrency_limit of 20 seems
379enough to noticeably load a system without bringing it to its knees.
380Be careful when changing this to a much larger number. </p>
381
382</ul>
383
384<p> The above default values of the concurrency limits work well
385in a broad range of situations. Knee-jerk changes to these parameters
386in the face of congestion can actually make problems worse.
387Specifically, large destination concurrencies should never be the
388default. They should be used only for transports that deliver mail
389to a small number of high volume domains.  </p>
390
391<p> A common situation where high concurrency is called for is on
392gateways relaying a high volume of mail between the Internet
393and an intranet mail environment. Approximately half the mail
394(assuming equal volumes inbound and outbound) will be destined
395for the internal mail hubs.  Since the internal mail hubs will be
396receiving all external mail exclusively from the gateway, it is
397reasonable to configure the gateway to make greater demands on the
398capacity of the internal SMTP servers. </p>
399
400<p> The tuning of the inbound concurrency limits need not be trial
401and error. A high volume capable mailhub should be able to easily
402handle 50 or 100 (rather than the default 20) simultaneous connections,
403especially if the gateway forwards to multiple MX hosts. When all
404MX hosts are up and accepting connections in a timely fashion,
405throughput will be high.  If any MX host is down and completely
406unresponsive, the average connection latency rises to at least 1/N
407* $smtp_connection_timeout, if there are N MX hosts. This limits
408throughput to at most the destination concurrency * N /
409$smtp_connection_timeout. </p>
410
411<p> For example, with a destination concurrency of 100 and 2 MX
412hosts, each host will handle up to 50 simultaneous connections. If
413one MX host is down and the default SMTP connection timeout is 30s,
414the throughput limit is 100 * 2 / 30 ~= 6 messages per second. This
415suggests that high volume destinations with good connectivity and
416multiple MX hosts need a lower connection timeout, values as low
417as 5s or even 1s can be used to prevent congestion when one or
418more, but not all MX hosts are down. </p>
419
420<p> If necessary, set a higher transport_destination_concurrency_limit
421(in main.cf since this is a queue manager parameter) and a lower
422smtp_connection_timeout (with a "-o" override in master.cf since
423this parameter has no per-transport name) for the relay transport
424and any transports dedicated for specific high volume destinations.
425</p>
426
427<h2><a name="rcpts">Tuning the number of recipients per delivery</a></h2>
428
429<p> The default_destination_recipient_limit parameter (default:
43050) controls how many recipients a Postfix delivery agent will send
431with each copy of an email message.  You can override this setting
432for specific Postfix delivery agents.  For example,
433"uucp_destination_recipient_limit = 100" would limit the number of
434recipients per UUCP delivery to 100. </p>
435
436<p> If an email message exceeds the recipient limit for some
437destination, the Postfix queue manager breaks up the list of
438recipients into smaller lists. Postfix will attempt to send multiple
439copies of the message in parallel. </p>
440
441<p> IMPORTANT: Be careful when increasing the recipient limit per
442message delivery; some SMTP servers abort the connection when they
443run out of memory or when a hard recipient limit is reached, so
444that the message will never be delivered. </p>
445
446<p> The smtpd_recipient_limit parameter (default: 1000) controls
447how many recipients the Postfix smtpd(8) server will take per
448delivery.  The default limit is more than any reasonable SMTP client
449would send. The limit exists to protect the local mail system
450against a run-away client. </p>
451
452<h2><a name="hammer">Tuning the frequency of deferred mail delivery attempts</a></h2>
453
454<p> When a Postfix delivery agent (smtp(8), local(8), etc.) is
455unable to deliver a message it may blame the message itself, or it
456may blame the receiving party. </p>
457
458<ul>
459
460<li> <p> When the delivery agent blames the message, the queue
461manager gives the queue file a time stamp into the future, so it
462won't be looked at for a while. By default, the amount of time to
463cool down is the amount of time that has passed since the message
464arrived.  This results in so-called exponential backoff behavior.
465</p>
466
467<li> <p> When the delivery agent blames the receiving party (for
468example a local recipient user, or a remote host), the queue manager
469not only advances the queue file time stamp, but also puts the
470receiving party on a "dead" list so that it will be skipped for
471some amount of time. </p>
472
473</ul>
474
475<p> This process is governed by a bunch of little parameters. </p>
476
477<blockquote>
478
479<dl>
480
481<dt> queue_run_delay (default: 300 seconds; before Postfix 2.4:
4821000s) </dt> <dd> How often
483the queue manager scans the queue for deferred mail. </dd>
484
485<dt> minimal_backoff_time (default: 300 seconds; before Postfix
4862.4: 1000s) </dt> <dd> The
487minimal amount of time a message won't be looked at, and the minimal
488amount of time to stay away from a "dead" destination. </dd>
489
490<dt> maximal_backoff_time (default: 4000 seconds) </dt> <dd> The
491maximal amount of time a message won't be looked at after a delivery
492failure. </dd>
493
494<dt> maximal_queue_lifetime (default: 5 days) </dt> <dd> How long
495a message stays in the queue before it is sent back as undeliverable.
496Specify 0 for mail that should be returned immediately after the
497first unsuccessful delivery attempt. </dd>
498
499<dt> bounce_queue_lifetime (default: 5 days, available with Postfix
500version 2.1 and later) </dt> <dd> How long a MAILER-DAEMON message
501stays in the queue before it is considered undeliverable.  Specify
5020 for mail that should be tried only once.  </dd>
503
504<dt> qmgr_message_recipient_limit (default: 20000) </dt> <dd> The
505size of many in-memory queue manager data structures. Among others,
506this parameter limits the size of the short-term, in-memory list
507of "dead" destinations. Destinations that don't fit the list are
508not added. </dd>
509
510<dt> <i>transport</i>_destination_concurrency_failed_cohort_limit
511</dt> <dd> Controls when a destination is considered "dead". This
512parameter is critical with a non-zero
513<i>transport</i>_destination_rate_delay, with a reduced
514<i>transport</i>_destination_concurrency_limit, or with
515a reduced initial_destination_concurrency.  </dd>
516
517</dl>
518
519</blockquote>
520
521<p> IMPORTANT: If you increase the frequency of deferred mail
522delivery attempts, or if you flush the deferred mail queue frequently,
523then you may find that Postfix mail delivery performance actually
524becomes worse. The symptoms are as follows:  </p>
525
526<ul>
527
528<li> <p> The active queue becomes saturated with mail that has
529delivery problems. New mail enters the active queue only when
530an old message is deferred. This is a slow process that usually
531requires timing out one or more SMTP connections. </p>
532
533<li> <p> All available Postfix delivery agents become occupied
534trying to connect to unreachable sites etc. New mail has to wait
535until a delivery agent becomes available. This is a slow process
536that usually requires timing out one or more SMTP connections. </p>
537
538</ul>
539
540<p> When mail is being deferred frequently, fixing the problem is
541always better than increasing the frequency of delivery attempts.
542However, if you can control only the delivery attempt frequency,
543consider using a dedicated fallback_relay "graveyard" machine for
544bad destinations, so that these destinations do not ruin the
545performance of normal
546mail deliveries.  </p>
547
548<h2><a name="proc_limit">Tuning the number of Postfix processes</a></h2>
549
550<p> The default_process_limit configuration parameter gives direct
551control over how many daemon processes Postfix will run.  As of
552Postfix 2.0 the default limit is 100 SMTP client processes, 100
553SMTP server processes, and so on.  This may overwhelm systems with
554little memory, as well as networks with low bandwidth.  </p>
555
556<p> You can change the global process limit by specifying a
557non-default default_process_limit in the main.cf file. For example,
558to run up to 10 SMTP client processes, 10 SMTP server processes,
559and so on: </p>
560
561<blockquote>
562<pre>
563/etc/postfix/main.cf:
564    default_process_limit = 10
565</pre>
566</blockquote>
567
568<p> You need to execute "postfix reload" to make the change effective.
569This limit is enforced by the Postfix master(8) daemon which does
570not automatically read main.cf when it changes. </p>
571
572<p> You can override the process limit for specific Postfix daemons
573by editing the master.cf file.  For example, if you do not wish to
574receive 100 SMTP messages at the same time, but do not want to
575change the process limits for other Postfix daemons, you could
576specify: </p>
577
578<blockquote>
579<pre>
580/etc/postfix/master.cf:
581    # ====================================================================
582    # service type  private unpriv  chroot  wakeup  maxproc command + args
583    #               (yes)   (yes)   (yes)   (never) (100)
584    # ====================================================================
585    . . .
586    smtp      inet  n       -       -       -       10      smtpd
587    . . .
588</pre>
589</blockquote>
590
591<h2><a name="proc_sys">Tuning the number of processes on the system</a></h2>
592
593<ul>
594
595<li> <p> MacOS X will run out of process slots when you increase
596Postfix process limits. The following works with OSX 10.4 and OSX
59710.5. </p>
598
599<p> MacOS X kernel parameters can be specified in /etc/sysctl.conf.
600</p>
601
602<pre>
603/etc/sysctl.conf:
604    kern.maxproc=2048
605    kern.maxprocperuid=2048
606</pre>
607
608<p> Unfortunately these can't simply be set on the fly with "sysctl
609-w".  You also have to set the following in /etc/launchd.conf so
610that the root user after boot will have the right process limit
611(2048).  Otherwise you have to always run ulimit -u 2048 as root,
612then start a user shell, and then start processes for things to
613take effect. </p>
614
615<pre>
616/etc/launchd.conf:
617    limit maxproc 2048
618</pre>
619
620<p> Once these are in place, reboot the system.  After that, the limits will
621stay in place. </p>
622
623</ul>
624
625<h2><a name="file_limit">Tuning the number of open files or sockets</a></h2>
626
627<p> When Postfix opens too many files or sockets, processes will
628abort with fatal errors, and the system may log "file table full"
629errors. </p>
630
631<ul>
632
633<li> <p> Depending on your Postfix and operating system versions
634you may need to recompile Postfix if you need more than 1024 file
635descriptors per process: </p>
636
637<ul> <li> <p> No recompilation is needed for Postfix version 2.4
638and later, when it was compiled for systems that support BSD kqueue(2)
639(FreeBSD 4.1, NetBSD 2.0, OpenBSD 2.9), Solaris 8 /dev/poll, or
640Linux 2.6 epoll(4).  </p>
641
642<li> <p> Otherwise, Postfix needs to be recompiled to override the
643default FD_SETSIZE value. </p>
644
645</ul>
646
647<li> <p> Reduce the number of processes as described under "<a
648href="#proc_limit">Tuning the number of Postfix processes</a>" above.
649Fewer processes need fewer open files and sockets. </p>
650
651<li> <p> Configure the kernel for more open files and sockets.
652The details are extremely system dependent and change with the
653operating system version. Be sure to verify the following information
654with your system tuning guide:  </p>
655
656<ul>
657
658<li> <p> Some FreeBSD kernel parameters can be specified in
659/boot/loader.conf, and some can be specified in /etc/sysctl.conf
660or changed with sysctl commands.
661Which is which depends on the version.
662</p>
663
664<pre>
665kern.ipc.maxsockets="5000"
666kern.ipc.nmbclusters="65536"
667kern.maxproc="2048"
668kern.maxfiles="16384"
669kern.maxfilesperproc="16384"
670</pre>
671
672<li> <p> Linux kernel parameters can be specified in /etc/sysctl.conf
673or changed with sysctl commands: </p>
674
675<pre>
676fs.file-max=16384
677kernel.threads-max=2048
678</pre>
679
680<li> <p> Solaris kernel parameters can be specified in /etc/system,
681as described in the <a
682href="http://www.science.uva.nl/pub/solaris/solaris2.html#q3.48">Solaris
683FAQ</a> entry titled "How can I increase the number of file
684descriptors per process?" </p>
685
686<pre>
687* set hard limit on file descriptors
688set rlim_fd_max = 4096
689* set soft limit on file descriptors
690set rlim_fd_cur = 1024
691</pre>
692
693</ul>
694
695</ul>
696
697</body>
698
699</html>
700