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_auth_rate_limit (default: no limit) </dt> <dd> 271The maximum number of AUTH commands that an SMTP client may send 272in the time interval specified with anvil_rate_time_unit (default: 27360s). Available in Postfix 3.1 and later. </dd> 274 275<dt> smtpd_client_event_limit_exceptions (default: $mynetworks) 276</dt> <dd> SMTP clients that are excluded from connection and rate 277limits specified above. </dd> 278 279</dl> 280 281</blockquote> 282 283<h2><a name="mailing_tips">General mail delivery performance tips</a></h2> 284 285<ul> 286 287<li> <p> Read and understand the maildrop queue, incoming queue, 288active queue and deferred queue discussions in the QSHAPE_README 289document. </p> 290 291<li> <p> In case of slow delivery, run the qshape tool as described 292in the QSHAPE_README document. </p> 293 294<li> <p> Submit multiple recipients per message instead of submitting 295messages with only a few recipients. </p> 296 297<li> <p> Submit mail via SMTP instead of /usr/sbin/sendmail. You 298may have to adjust the smtpd_recipient_limit parameter setting. 299</p> 300 301<li> <p> Don't overwhelm the disk with mail submissions. Optimize 302the mail submission rate by tuning the number of parallel submissions 303and/or by tuning the Postfix in_flow_delay parameter setting. </p> 304 305<li> <p> Run a local name server to reduce slow-down due to DNS 306lookups. If you run multiple Postfix systems, point each local name 307server to a shared forwarding server to reduce the number of lookups 308across the upstream network link. </p> 309 310<li> <p> Reduce the smtp_connect_timeout and smtp_helo_timeout 311values so that Postfix does not waste lots of time connecting 312to non-responding remote SMTP servers. </p> 313 314<li> <p> Use a dedicated mail delivery transport for problematic 315destinations, with reduced timeouts and with adjusted concurrency. 316See "<a href="#rope">Tuning the number of simultaneous deliveries</a>" 317below. 318</p> 319 320<li> <p> Use a fallback_relay host for mail that cannot be delivered 321upon the first attempt. This "graveyard" machine can use shorter 322retry times for difficult to reach destinations. See "<a 323href="#hammer">Tuning the frequency of deferred mail delivery 324attempts</a>" below. </p> 325 326<li> <p> Speed up disk updates with a large (64MB) persistent write 327cache. This allows disk updates to be sorted for optimal access 328speed without compromising file system integrity when the system 329crashes. </p> 330 331<li> <p> Use a solid-state disk (a persistent RAM disk). This 332is an expensive solution that should be used in combination 333with short SMTP timeouts and a fallback_relay "graveyard" 334machine that delivers mail for problem destinations. </p> 335 336</ul> 337 338<h2><a name="rope">Tuning the number of simultaneous deliveries</a></h2> 339 340<p> Although Postfix can be configured to run 1000 SMTP client 341processes at the same time, it is rarely desirable that it makes 3421000 simultaneous connections to the same remote system. For this 343reason, Postfix has safety mechanisms in place to avoid this 344so-called "thundering herd" problem. </p> 345 346<p> The Postfix queue manager implements the analog of the TCP slow 347start flow control strategy: when delivering to a site, send a 348small number of messages first, then increase the concurrency as 349long as all goes well; reduce concurrency in the face of congestion. 350</p> 351 352<ul> 353 354<li> <p> The initial_destination_concurrency parameter (default: 5) 355controls how many messages are initially sent to the same destination 356before adapting delivery concurrency. Of course, this setting is 357effective only as long as it does not exceed the process limit and 358the destination concurrency limit for the specific mail transport 359channel. </p> 360 361<li> <p> The default_destination_concurrency_limit parameter (default: 36220) controls how many messages may be sent to the same destination 363simultaneously. You can override this setting for specific message 364delivery transports by taking the name of the master.cf entry 365and appending "_destination_concurrency_limit". </p> 366 367</ul> 368 369<p> Examples of transport specific concurrency limits are: </p> 370 371<ul> 372 373<li> <p> The local_destination_concurrency_limit parameter (default: 3742) controls how many messages are delivered simultaneously to the 375same local recipient. The recommended limit is low because delivery 376to the same mailbox must happen sequentially, so massive parallelism 377is not useful. Another good reason to limit delivery concurrency 378to the same recipient: if the recipient has an expensive shell 379command in her .forward file, or if the recipient is a mailing list 380manager, you don't want to run too many instances of those processes 381at the same time. </p> 382 383<li> <p> The default smtp_destination_concurrency_limit of 20 seems 384enough to noticeably load a system without bringing it to its knees. 385Be careful when changing this to a much larger number. </p> 386 387</ul> 388 389<p> The above default values of the concurrency limits work well 390in a broad range of situations. Knee-jerk changes to these parameters 391in the face of congestion can actually make problems worse. 392Specifically, large destination concurrencies should never be the 393default. They should be used only for transports that deliver mail 394to a small number of high volume domains. </p> 395 396<p> A common situation where high concurrency is called for is on 397gateways relaying a high volume of mail between the Internet 398and an intranet mail environment. Approximately half the mail 399(assuming equal volumes inbound and outbound) will be destined 400for the internal mail hubs. Since the internal mail hubs will be 401receiving all external mail exclusively from the gateway, it is 402reasonable to configure the gateway to make greater demands on the 403capacity of the internal SMTP servers. </p> 404 405<p> The tuning of the inbound concurrency limits need not be trial 406and error. A high volume capable mailhub should be able to easily 407handle 50 or 100 (rather than the default 20) simultaneous connections, 408especially if the gateway forwards to multiple MX hosts. When all 409MX hosts are up and accepting connections in a timely fashion, 410throughput will be high. If any MX host is down and completely 411unresponsive, the average connection latency rises to at least 1/N 412* $smtp_connection_timeout, if there are N MX hosts. This limits 413throughput to at most the destination concurrency * N / 414$smtp_connection_timeout. </p> 415 416<p> For example, with a destination concurrency of 100 and 2 MX 417hosts, each host will handle up to 50 simultaneous connections. If 418one MX host is down and the default SMTP connection timeout is 30s, 419the throughput limit is 100 * 2 / 30 ~= 6 messages per second. This 420suggests that high volume destinations with good connectivity and 421multiple MX hosts need a lower connection timeout, values as low 422as 5s or even 1s can be used to prevent congestion when one or 423more, but not all MX hosts are down. </p> 424 425<p> If necessary, set a higher transport_destination_concurrency_limit 426(in main.cf since this is a queue manager parameter) and a lower 427smtp_connection_timeout (with a "-o" override in master.cf since 428this parameter has no per-transport name) for the relay transport 429and any transports dedicated for specific high volume destinations. 430</p> 431 432<h2><a name="rcpts">Tuning the number of recipients per delivery</a></h2> 433 434<p> The default_destination_recipient_limit parameter (default: 43550) controls how many recipients a Postfix delivery agent will send 436with each copy of an email message. You can override this setting 437for specific Postfix delivery agents. For example, 438"uucp_destination_recipient_limit = 100" would limit the number of 439recipients per UUCP delivery to 100. </p> 440 441<p> If an email message exceeds the recipient limit for some 442destination, the Postfix queue manager breaks up the list of 443recipients into smaller lists. Postfix will attempt to send multiple 444copies of the message in parallel. </p> 445 446<p> IMPORTANT: Be careful when increasing the recipient limit per 447message delivery; some SMTP servers abort the connection when they 448run out of memory or when a hard recipient limit is reached, so 449that the message will never be delivered. </p> 450 451<p> The smtpd_recipient_limit parameter (default: 1000) controls 452how many recipients the Postfix smtpd(8) server will take per 453delivery. The default limit is more than any reasonable SMTP client 454would send. The limit exists to protect the local mail system 455against a run-away client. </p> 456 457<h2><a name="hammer">Tuning the frequency of deferred mail delivery attempts</a></h2> 458 459<p> When a Postfix delivery agent (smtp(8), local(8), etc.) is 460unable to deliver a message it may blame the message itself, or it 461may blame the receiving party. </p> 462 463<ul> 464 465<li> <p> When the delivery agent blames the message, the queue 466manager gives the queue file a time stamp into the future, so it 467won't be looked at for a while. By default, the amount of time to 468cool down is the amount of time that has passed since the message 469arrived. This results in so-called exponential backoff behavior. 470</p> 471 472<li> <p> When the delivery agent blames the receiving party (for 473example a local recipient user, or a remote host), the queue manager 474not only advances the queue file time stamp, but also puts the 475receiving party on a "dead" list so that it will be skipped for 476some amount of time. </p> 477 478</ul> 479 480<p> This process is governed by a bunch of little parameters. </p> 481 482<blockquote> 483 484<dl> 485 486<dt> queue_run_delay (default: 300 seconds; before Postfix 2.4: 4871000s) </dt> <dd> How often 488the queue manager scans the queue for deferred mail. </dd> 489 490<dt> minimal_backoff_time (default: 300 seconds; before Postfix 4912.4: 1000s) </dt> <dd> The 492minimal amount of time a message won't be looked at, and the minimal 493amount of time to stay away from a "dead" destination. </dd> 494 495<dt> maximal_backoff_time (default: 4000 seconds) </dt> <dd> The 496maximal amount of time a message won't be looked at after a delivery 497failure. </dd> 498 499<dt> maximal_queue_lifetime (default: 5 days) </dt> <dd> How long 500a message stays in the queue before it is sent back as undeliverable. 501Specify 0 for mail that should be returned immediately after the 502first unsuccessful delivery attempt. </dd> 503 504<dt> bounce_queue_lifetime (default: 5 days, available with Postfix 505version 2.1 and later) </dt> <dd> How long a MAILER-DAEMON message 506stays in the queue before it is considered undeliverable. Specify 5070 for mail that should be tried only once. </dd> 508 509<dt> qmgr_message_recipient_limit (default: 20000) </dt> <dd> The 510size of many in-memory queue manager data structures. Among others, 511this parameter limits the size of the short-term, in-memory list 512of "dead" destinations. Destinations that don't fit the list are 513not added. </dd> 514 515<dt> <i>transport</i>_destination_concurrency_failed_cohort_limit 516</dt> <dd> Controls when a destination is considered "dead". This 517parameter is critical with a non-zero 518<i>transport</i>_destination_rate_delay, with a reduced 519<i>transport</i>_destination_concurrency_limit, or with 520a reduced initial_destination_concurrency. </dd> 521 522</dl> 523 524</blockquote> 525 526<p> IMPORTANT: If you increase the frequency of deferred mail 527delivery attempts, or if you flush the deferred mail queue frequently, 528then you may find that Postfix mail delivery performance actually 529becomes worse. The symptoms are as follows: </p> 530 531<ul> 532 533<li> <p> The active queue becomes saturated with mail that has 534delivery problems. New mail enters the active queue only when 535an old message is deferred. This is a slow process that usually 536requires timing out one or more SMTP connections. </p> 537 538<li> <p> All available Postfix delivery agents become occupied 539trying to connect to unreachable sites etc. New mail has to wait 540until a delivery agent becomes available. This is a slow process 541that usually requires timing out one or more SMTP connections. </p> 542 543</ul> 544 545<p> When mail is being deferred frequently, fixing the problem is 546always better than increasing the frequency of delivery attempts. 547However, if you can control only the delivery attempt frequency, 548consider using a dedicated fallback_relay "graveyard" machine for 549bad destinations, so that these destinations do not ruin the 550performance of normal 551mail deliveries. </p> 552 553<h2><a name="proc_limit">Tuning the number of Postfix processes</a></h2> 554 555<p> The default_process_limit configuration parameter gives direct 556control over how many daemon processes Postfix will run. As of 557Postfix 2.0 the default limit is 100 SMTP client processes, 100 558SMTP server processes, and so on. This may overwhelm systems with 559little memory, as well as networks with low bandwidth. </p> 560 561<p> You can change the global process limit by specifying a 562non-default default_process_limit in the main.cf file. For example, 563to run up to 10 SMTP client processes, 10 SMTP server processes, 564and so on: </p> 565 566<blockquote> 567<pre> 568/etc/postfix/main.cf: 569 default_process_limit = 10 570</pre> 571</blockquote> 572 573<p> You need to execute "postfix reload" to make the change effective. 574This limit is enforced by the Postfix master(8) daemon which does 575not automatically read main.cf when it changes. </p> 576 577<p> You can override the process limit for specific Postfix daemons 578by editing the master.cf file. For example, if you do not wish to 579receive 100 SMTP messages at the same time, but do not want to 580change the process limits for other Postfix daemons, you could 581specify: </p> 582 583<blockquote> 584<pre> 585/etc/postfix/master.cf: 586 # ==================================================================== 587 # service type private unpriv chroot wakeup maxproc command + args 588 # (yes) (yes) (yes) (never) (100) 589 # ==================================================================== 590 . . . 591 smtp inet n - - - 10 smtpd 592 . . . 593</pre> 594</blockquote> 595 596<h2><a name="proc_sys">Tuning the number of processes on the system</a></h2> 597 598<ul> 599 600<li> <p> MacOS X will run out of process slots when you increase 601Postfix process limits. The following works with OSX 10.4 and OSX 60210.5. </p> 603 604<p> MacOS X kernel parameters can be specified in /etc/sysctl.conf. 605</p> 606 607<pre> 608/etc/sysctl.conf: 609 kern.maxproc=2048 610 kern.maxprocperuid=2048 611</pre> 612 613<p> Unfortunately these can't simply be set on the fly with "sysctl 614-w". You also have to set the following in /etc/launchd.conf so 615that the root user after boot will have the right process limit 616(2048). Otherwise you have to always run ulimit -u 2048 as root, 617then start a user shell, and then start processes for things to 618take effect. </p> 619 620<pre> 621/etc/launchd.conf: 622 limit maxproc 2048 623</pre> 624 625<p> Once these are in place, reboot the system. After that, the limits will 626stay in place. </p> 627 628</ul> 629 630<h2><a name="file_limit">Tuning the number of open files or sockets</a></h2> 631 632<p> When Postfix opens too many files or sockets, processes will 633abort with fatal errors, and the system may log "file table full" 634errors. </p> 635 636<ul> 637 638<li> <p> Depending on your Postfix and operating system versions 639you may need to recompile Postfix if you need more than 1024 file 640descriptors per process: </p> 641 642<ul> <li> <p> No recompilation is needed for Postfix version 2.4 643and later, when it was compiled for systems that support BSD kqueue(2) 644(FreeBSD 4.1, NetBSD 2.0, OpenBSD 2.9), Solaris 8 /dev/poll, or 645Linux 2.6 epoll(4). </p> 646 647<li> <p> Otherwise, Postfix needs to be recompiled to override the 648default FD_SETSIZE value. </p> 649 650</ul> 651 652<li> <p> Reduce the number of processes as described under "<a 653href="#proc_limit">Tuning the number of Postfix processes</a>" above. 654Fewer processes need fewer open files and sockets. </p> 655 656<li> <p> Configure the kernel for more open files and sockets. 657The details are extremely system dependent and change with the 658operating system version. Be sure to verify the following information 659with your system tuning guide: </p> 660 661<ul> 662 663<li> <p> Some FreeBSD kernel parameters can be specified in 664/boot/loader.conf, and some can be specified in /etc/sysctl.conf 665or changed with sysctl commands. 666Which is which depends on the version. 667</p> 668 669<pre> 670kern.ipc.maxsockets="5000" 671kern.ipc.nmbclusters="65536" 672kern.maxproc="2048" 673kern.maxfiles="16384" 674kern.maxfilesperproc="16384" 675</pre> 676 677<li> <p> Linux kernel parameters can be specified in /etc/sysctl.conf 678or changed with sysctl commands: </p> 679 680<pre> 681fs.file-max=16384 682kernel.threads-max=2048 683</pre> 684 685<li> <p> Solaris kernel parameters can be specified in /etc/system, 686as described in the <a 687href="http://www.science.uva.nl/pub/solaris/solaris2.html#q3.48">Solaris 688FAQ</a> entry titled "How can I increase the number of file 689descriptors per process?" </p> 690 691<pre> 692* set hard limit on file descriptors 693set rlim_fd_max = 4096 694* set soft limit on file descriptors 695set rlim_fd_cur = 1024 696</pre> 697 698</ul> 699 700</ul> 701 702</body> 703 704</html> 705