ZXTM FD fix patch

NOTE: This FAQ does not apply to ZXTM 3.1r1 and later.

You can look to see how many concurrent connections each ZXTM thinks it can handle by looking at "System" -> "Traffic Managers", and then looking under the "Software" heading for "Concurrency Limit". By default, an untuned Linux system will read "502" (or similar).

This document describes one good way to increase this limit on recent Linux kernels (2.6.9 and later).

ZXTM performs best on Linux 2.6 kernels, due to networking infrastructure improvements. Since approximately Linux 2.6.9, the maximum number of available File Descriptors (indicated by /proc/sys/fs/file-max) is auto-tuned depending on the power of the hardware the kernel is running on, and is usually a good choice. However, if you want to increase this then the best way is to add the line:

fs.file-max = 65536

... to the "/etc/sysctl.conf" file. You can substitute "65536" for a larger number of your choice if you wish. This should take effect after the next reboot, and the value reported by /proc/sys/fs/file-max should be identical to the value chosen above.

The above tuning will increase the system limit for the absolute total number of File Descriptors that should be usable at any one time, but the per-process limit still needs to be addressed.

This can generally be achieved by editing /etc/security/limits.conf, as documented in the ZXTM File Descriptors page on the support website. However, we have recently discovered that versions of Linux using recent versions of PAM do not honour these changes. This is the case if, after editing /etc/security/limits.conf, the Concurrency Limit is still about 500. We already have a fix for this that will be incorporated into our next release, but in the meantime the best solution is to apply the following patch to $ZEUSHOME/zxtm/rc:

--- rc      2005-04-12 19:31:51.912347120 +0100
+++ rc.new2005-04-12 19:32:49.865536896 +0100
@@ -126,8 +126,18 @@
        fi
     ;;
     *) ;;
-   esac
-  
+  esac
+  fdlimit=`ulimit -n`
+  fdnumber=65535
+  if [ $fdlimit = "1024" ]
+  then
+    echo '************************************************************'
+    echo "Warning FD limit is too low ($fdlimit).  Attempting to"
+    echo "increase value to $fdnumber."
+    ulimit -n $fdnumber
+    echo "Limit is now `ulimit -n`"
+    echo '************************************************************'
+  fi
 }

 sendemails()
@@ -153,6 +163,7 @@
        ;;

     'restart')
+       checksysctl
        sendemails
        stop_pid "$ZXTM_PIDFILE" "$PROGRAM" && \
            $ZEUSHOME/zxtm/bin/zeus.zxtm && echo Restarted $PROGRAM

To do this, copy the lines above into a file named zxtm.rc.patch. Please ensure that your mail client hasn't wrapped any lines. Save this file into the $ZEUSHOME/zxtm directory. Now type "cat zxtm.rc.patch | patch -l", which should output (only) "patching file rc".

With this done, ZXTM will warn you if the default number of available file descriptors is too low, and attempt to raise this level. If you restart ZXTM after applying this patch, you should find that your Concurrency Limit now shows a much higher value.

This change is safe to leave in place until the next release of ZXTM, and means that ZXTM can be started unattended without the need for manual intervention.

Stuart Shelton [Zeus Support] 01 July 2005 Bookmark with del.icio.us Post this article to Digg Post this article to reddit Post this article to Facebook Tweet this article  
Leave a comment ...
Your email address will not be displayed.
Your URL will be displayed.
This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.
Options:
 
(Line breaks become <br />)
(Set cookies for name, email & url)

Recently...

Other Resources