<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.qmailtoaster.org:80/index.php?action=history&amp;feed=atom&amp;title=TCP_Server_limits_configuration</id>
	<title>TCP Server limits configuration - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.qmailtoaster.org:80/index.php?action=history&amp;feed=atom&amp;title=TCP_Server_limits_configuration"/>
	<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=TCP_Server_limits_configuration&amp;action=history"/>
	<updated>2026-04-29T11:00:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>http://wiki.qmailtoaster.org:80/index.php?title=TCP_Server_limits_configuration&amp;diff=166&amp;oldid=prev</id>
		<title>Ebroch: Created page with &quot;http://iserve01.i-serve.net/ucspi-tcp-toaster-0.88-1.3.4.src.rpm  The variables are:  (1) MAXLOAD      maximum 1-minute load average * 100. For example, if you have line     :allow,MAXLOAD=&quot;350&quot;      in your rules file from which you created .cdb, the connection will be     accepted only if load average is below 3.50     (2) MAXCONNIP     maximum connections from one IP address. tcpserver&#039;s -c flag defines     maximum number of allowed connections, but it can be abused i...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=TCP_Server_limits_configuration&amp;diff=166&amp;oldid=prev"/>
		<updated>2024-03-16T16:56:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;http://iserve01.i-serve.net/ucspi-tcp-toaster-0.88-1.3.4.src.rpm  The variables are:  (1) MAXLOAD      maximum 1-minute load average * 100. For example, if you have line     :allow,MAXLOAD=&amp;quot;350&amp;quot;      in your rules file from which you created .cdb, the connection will be     accepted only if load average is below 3.50     (2) MAXCONNIP     maximum connections from one IP address. tcpserver&amp;#039;s -c flag defines     maximum number of allowed connections, but it can be abused i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;http://iserve01.i-serve.net/ucspi-tcp-toaster-0.88-1.3.4.src.rpm&lt;br /&gt;
&lt;br /&gt;
The variables are:&lt;br /&gt;
&lt;br /&gt;
(1) MAXLOAD &lt;br /&gt;
    maximum 1-minute load average * 100. For example, if you have line&lt;br /&gt;
    :allow,MAXLOAD=&amp;quot;350&amp;quot; &lt;br /&gt;
    in your rules file from which you created .cdb, the connection will be&lt;br /&gt;
    accepted only if load average is below 3.50&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
(2) MAXCONNIP&lt;br /&gt;
    maximum connections from one IP address. tcpserver&amp;#039;s -c flag defines&lt;br /&gt;
    maximum number of allowed connections, but it can be abused if&lt;br /&gt;
    just one host goes wild and eats all the connections - no other host&lt;br /&gt;
    would be able to connect then. If you created your .cdb with:&lt;br /&gt;
    :allow,MAXCONNIP=&amp;quot;5&amp;quot;&lt;br /&gt;
    and run tcpserver -c 50, then each IP address would be able to have at &lt;br /&gt;
    most 5 concurrent connections, while there still could connect 50&lt;br /&gt;
    clients total.&lt;br /&gt;
    0 is valid value and means &amp;#039;always reject&amp;#039;&lt;br /&gt;
&lt;br /&gt;
(3) MAXCONNC&lt;br /&gt;
&lt;br /&gt;
    maximum connections from whole C-class (256 addresses). Extension of&lt;br /&gt;
    MAXCONNIP, as sometimes the problematic client has a whole farm of&lt;br /&gt;
    client machines with different IP addresses instead of just one IP&lt;br /&gt;
    address, and they all try to connect. It might have been more useful to&lt;br /&gt;
    be able to specify CIDR block than C-class, but I&amp;#039;ve decided to KISS.&lt;br /&gt;
&lt;br /&gt;
    for example tcpserver -c 200, and .cdb with:&lt;br /&gt;
    :allow,MAXCONNC=&amp;quot;15&amp;quot;&lt;br /&gt;
    will allow at most 15 host from any x.y.z.0/24 address block, while&lt;br /&gt;
    still allowing up to 200 total connections.&lt;br /&gt;
    0 is valid value and means &amp;#039;always reject&amp;#039;&lt;br /&gt;
&lt;br /&gt;
(4) DIEMSG&lt;br /&gt;
    &lt;br /&gt;
    if set and one of the above limits is exceeded, this is the message &lt;br /&gt;
    to be sent to client (CRLF is always added to the text) before terminating&lt;br /&gt;
    connection. If unset, the connection simply terminates (after 1 sec delay) &lt;br /&gt;
    if limit is exceeded.&lt;br /&gt;
&lt;br /&gt;
    For example:&lt;br /&gt;
    DIEMSG=&amp;quot;421 example.com Service temporarily not available, closing &lt;br /&gt;
    transmission channel&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
- if a connection is dropped due to some of those variables set, it will be&lt;br /&gt;
  flagged (if you run tcpserver -v) with &amp;quot;LOAD:&amp;quot;, &amp;quot;MAXCONNIP:&amp;quot; or&lt;br /&gt;
  &amp;quot;MAXCONNC:&amp;quot; at the end of the &amp;quot;tcpserver: deny&amp;quot; line. If that bothers you&lt;br /&gt;
  (eg. you have a strict log parsers), don&amp;#039;t apply that chunk of the patch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you make changes, please check that they work as expected. &lt;br /&gt;
&lt;br /&gt;
Examples (for tcprules created .cdb)&lt;br /&gt;
(a) 192.168.:allow,MAXLOAD=&amp;quot;1000&amp;quot;&lt;br /&gt;
    :allow,MAXCONNIP=&amp;quot;3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    this would allow any connection from your local LAN (192.168.*.*&lt;br /&gt;
    addresses) if system load is less than 10.00. non-LAN connections would&lt;br /&gt;
    be accepted only if clients from that IP address have not already opened&lt;br /&gt;
    more than 2 connections (as your connection would be last allowed -- 3rd)&lt;br /&gt;
&lt;br /&gt;
(b) 192.168.:allow&lt;br /&gt;
    5.6.7.8:allow,MAXCONNIP=&amp;quot;3&amp;quot;&lt;br /&gt;
    1.2.:allow,MAXLOAD=&amp;quot;500&amp;quot;,MAXCONNIP=&amp;quot;1&amp;quot;,MAXCONNC=&amp;quot;5&amp;quot;&lt;br /&gt;
    :allow,MAXLOAD=&amp;quot;1000&amp;quot;,MAXCONNIP=&amp;quot;3&amp;quot;,DIEMSG=&amp;quot;421 example.com unavailable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if client connects from 192.168.*.* (ex: your LAN), it is allowed.&lt;br /&gt;
    if it connects from 5.6.7.8 (ex: little abusive customer of yours),&lt;br /&gt;
     it is allowed unless there are already 3active connections from 5.6.7.8&lt;br /&gt;
     to this service&lt;br /&gt;
    if it connects from 1.2.*.* (ex: some problematic networks which caused&lt;br /&gt;
     you grief in the past) it will connect only if load is less than 5.0,&lt;br /&gt;
     there is less than 5 active connections from whole C class&lt;br /&gt;
     (1.2.*.0/24), and if that specific IP address does not already have&lt;br /&gt;
     connection open.&lt;br /&gt;
    in all other cases, the client will be permitted to connect if load is&lt;br /&gt;
     less than 10.00 and client has 2 or less connections open. If load is&lt;br /&gt;
     higher than 10.00 or there are 3 or more connections open from this&lt;br /&gt;
     client, the message &amp;quot;421 example.com unavailable&amp;quot; will be returned to &lt;br /&gt;
     the client and connection terminated.&lt;/div&gt;</summary>
		<author><name>Ebroch</name></author>
	</entry>
</feed>