Summary: Soft limit vs. Hard limit on file descriptors

From: Ju-Lien Lim (julienlim@rocketmail.com)
Date: Thu Nov 20 1997 - 07:19:59 CST


My original question:
   I'm looking into increasing the limit on my file
descriptors (for my server running realtime audio).
   In doing so, I encountered two different kinds of
limits, i.e. soft vs. hard.

   Can anyone tell me what the difference between
soft limit vs. hard limit on file descriptors?

My thanks to the following people for their
explanations and recommendations:
   Bismark Espinoza <bismark@alta.Jpl.Nasa.Gov>
   Kris Briscoe <brisco_k@adm-srv.sat.mot.com>
   Andy Korczynski <andyk@wheaton.rice.iit.edu>
   Shriman Gurung <SG@datcon.co.uk>
   Kevin Sheehan <Kevin.Sheehan@uniq.com.au>
   David Thorburn-Gundlach <david@bae.uga.edu>

Thanks!

   Ju
   julienlim@rocketmail.com

---
Summary:
Hard limits are a kernel-configurable item, and users
can't exceed them.  Soft limits are the user
defaults, and users can change that using the ulimit
program or the limit/unlimit builtins.

man setrlimit(2)

Basically, soft limits can be changed to anything up to the hard limit.

Think of soft limits as the warning barrier. When a user reaches the soft limit they will get an warning message but are still allowed to use more space up to the hard limit. Also, you can configure the system to set expiration times for users who have exceeded thier soft limit.

Just remember that the max file descriptors is 1024.

As for file descriptors, one good way to conserve them is to use mmap(2) for file access. You can close the file descriptor after you establish the mapping. Much faster, uses less resources, and it saves on fds. __________________________________________________________________ Sent by Yahoo! Mail. Get your free e-mail at http://mail.yahoo.com



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:09 CDT