file descriptors

file descriptors

Post by Vinod Meno » Sat, 20 Jul 1996 04:00:00



Hello,

   I need to (urgently!) increase the # of file descriptors to about
4000 from the current 1024 under Solaris 2.5. How do I go about doing
this?

       Many thanks in advance. Please email me.

             - Vinod
PS:

(tcsh> limit  
     returns

cputime         unlimited
filesize        unlimited
datasize        2097148 kbytes
stacksize       2097148 kbytes
coredumpsize    unlimited
memoryuse       unlimited
descriptors     1024 )

 
 
 

file descriptors

Post by Bill Zissimopoulo » Sat, 27 Jul 1996 04:00:00




> >Hello,

> >   I need to (urgently!) increase the # of file descriptors to about
> >4000 from the current 1024 under Solaris 2.5. How do I go about doing
> >this?

> I can only think of forking another proccess out (about 4 I'd guess) and
> having them open 1000 descriptors. Bit tricky :)

To the original poster. You get rid of the program that needs 4000
descriptors. It must be seriously brain-damaged.

Bill
--

<http://www-dept.cs.ucl.ac.uk/students/B.Zissimopoulos/>

 
 
 

file descriptors

Post by Rory Fost » Sat, 27 Jul 1996 04:00:00




|> >Hello,
|> >    
|> >   I need to (urgently!) increase the # of file descriptors to about
|> >4000 from the current 1024 under Solaris 2.5. How do I go about doing
|> >this?
|>
|> I can only think of forking another proccess out (about 4 I'd guess) and
|> having them open 1000 descriptors. Bit tricky :)
|>

Understood we're talking about Solaris, but this is a tuneable parameter
on the SVR4 system I'm running on, namely SFNOLIM and HFNOLIM.  Perhaps
there is an analogous tuneable on Solaris.

--
Regards,
Rory Foster

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
 
 

file descriptors

Post by Robert Liste » Sat, 27 Jul 1996 04:00:00



> Hello,

>    I need to (urgently!) increase the # of file descriptors to about
> 4000 from the current 1024 under Solaris 2.5. How do I go about doing
> this?

>        Many thanks in advance. Please email me.

>              - Vinod
> PS:

> (tcsh> limit
>      returns

> cputime         unlimited
> filesize        unlimited
> datasize        2097148 kbytes
> stacksize       2097148 kbytes
> coredumpsize    unlimited
> memoryuse       unlimited
> descriptors     1024 )

check out ulimit(1)
--
Bob Lister
 
 
 

file descriptors

Post by Shado » Sat, 27 Jul 1996 04:00:00



>Hello,

>   I need to (urgently!) increase the # of file descriptors to about
>4000 from the current 1024 under Solaris 2.5. How do I go about doing
>this?

I can only think of forking another proccess out (about 4 I'd guess) and
having them open 1000 descriptors. Bit tricky :)
--
Thamer Al-Herbish

But not today, the Fed said; your modern hacker was about as romantic as
a hit man from some ice possee or an enforcer with a dancer combine.
        William Gibson - 'Virtual Light'
-------------------------------------------------------------------------------

 
 
 

file descriptors

Post by Casper H.S. D » Mon, 29 Jul 1996 04:00:00





>|> >Hello,
>|> >    
>|> >   I need to (urgently!) increase the # of file descriptors to about
>|> >4000 from the current 1024 under Solaris 2.5. How do I go about doing
>|> >this?
>|>
>|> I can only think of forking another proccess out (about 4 I'd guess) and
>|> having them open 1000 descriptors. Bit tricky :)
>|>
>Understood we're talking about Solaris, but this is a tuneable parameter
>on the SVR4 system I'm running on, namely SFNOLIM and HFNOLIM.  Perhaps
>there is an analogous tuneable on Solaris.

As root, you can just use setrlimit, gloablly you can change it like this:

The solaris FAQ says:

3.43) How can I increase the number of file descriptors per process?

    In 2.3 in earlier this requires poking the kernel.
    In Solaris 2.4+, this can be accomplished by adding the
    following lines to /etc/system:

        * set hard limit on file descriptors
        set rlim_fd_max = 4096
        * set soft limit on file descriptors
        set rlim_fd_cur = 1024

    Raising the soft limit past 256 may confuse certain applications,
    especially BCP applications.  Raising the limit past 1024 may
    confuse applications that use select().

    --- end of excerpt from the FAQ

Questions marked with a * or + have been changed or added since
the FAQ was last posted

The most recently posted version of the FAQ is available from
<http://www.fwi.uva.nl/pub/solaris/solaris2/>
--
Casper Dik - Sun Microsystems - via my guest account at the University

Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

file descriptors

Post by Matus Uhl » Wed, 31 Jul 1996 04:00:00



-> To the original poster. You get rid of the program that needs 4000
-> descriptors. It must be seriously brain-damaged.

IRC server can provide too many client connections, probably other servers
can do it too... I've seen IRC server with 960 connections.
--
 Matus Uhlar, sysadm at Regional node of SANET in Kosice, Slovakia


 The 3 biggest disasters: Hiroshima 45, Tchernobyl 86, Windows 95

 
 
 

file descriptors

Post by Armin Grun » Wed, 31 Jul 1996 04:00:00



: -> To the original poster. You get rid of the program that needs 4000
: -> descriptors. It must be seriously brain-damaged.
:
: IRC server can provide too many client connections, probably other servers
: can do it too... I've seen IRC server with 960 connections.

Well, it is actually the somehow braindamages (others say
not-well-scaling) concept of IRC using the connection oriented
transport protocol instead of a datagram service sich as UDP ...
this would reduce the amount of filedescriptors need to: 1.

--
  Gruss,

                                                                     ____
                    Armin Gruner, Technische Universitaet, Muenchen  \  /
                    http://www.leo.org/~gruner/                       \/
                    Nur wer sich aendert, bleibt sich treu - Wolf Biermann

 
 
 

file descriptors

Post by Martin Ibe » Thu, 01 Aug 1996 04:00:00


: IRC server can provide too many client connections, probably other servers
: can do it too... I've seen IRC server with 960 connections.

All in the same process? It is clear (IMHO) that such a number of open
files for the system as a whole is perfectly reasonable.
--
---------------------------------------------------------------------------
Dipl.-Inform. Martin Ibert, BB-DATA GmbH, Brunnenstra?e 111, D-13355 Berlin
---------------------------------------------------------------------------

Quote:>> Disclaimer: My views do not necessarily reflect those of my employer. <<

 
 
 

file descriptors

Post by Theo de Raa » Sat, 03 Aug 1996 04:00:00


   : IRC server can provide too many client connections, probably other servers
   : can do it too... I've seen IRC server with 960 connections.

   All in the same process? It is clear (IMHO) that such a number of open
   files for the system as a whole is perfectly reasonable.

I have opened 1400 file descriptors in a single process under OpenBSD
and done select() on all of them.  In my code I had to expand
FD_SETSIZE (to 1400) before including <sys/types.h>

This did not require a special kernel; I don't know which other
operating systems support this by default.  Most only consider
FD_SETSIZE or 1024 or so descriptors.

For situations like this, the poll(2) system call is sometimes better
to use if your operatingg system has it.  If the poll file descriptor
data structure array is carefully managed this can result in lower
kernel overhead if you know only a few descriptors in a large space
are of intereest.  Remember, for select() the kernel is potentially
doing 3 sets of bit-array traversals using ffs().  Unfortunately
poll(2) uses a different timeout field ("int millisecs" instead of
"struct timeval *"), so the convertion of existing code is not
neccessarily trivial.  Yes, OpenBSD has poll(2) as well :-)

Another thing to note is that expanded FD_SETSIZE's often cause
problems for YP or the RPC code (this is something I still need to
fix, grr).

ps. I have an admission to make. All 1400 file descriptors were
dup()'d from fileno(stdin).  But the test did work! :-)
--

 
 
 

1. "Bad file descriptor" with Bash; how to designate descriptors?

I have a trivial script which tails multiple files by
spawning a 'tail' process for each file and duping the
output into one file descriptor which is then tailed:

  for f in $*; do
        tail -1f $f >&3 &
  done

  exec <&3
  tail -f

This works fine under Sun ksh, but I've just tried to run
it now with Bash under Linux 2.4.16, only to have each
command using file descriptor 3 fail with a

  'Bad file descriptor'

error.

This has caught me completely unawares.  The bash manpage
says that

  "If the digits in word do not specify a file descriptor open
  for output, a redirection error occurs"

How do I open file descriptor 3 for output?  Or, if I do
something like

  tail -1f file > /dev/null &

how can I find out what file descriptor is opened so I can
direct the output of further tail commands to the same
descriptor?  What's the magic that bash needs to be able to
do something like this?

Many thanks,

Brad

2. setting permissions

3. portable way to convert FILE ptr to file descriptor?

4. IP forwarding, configure two interfaces

5. how to get file length from file descriptor

6. How to disable searching with the location bar

7. *FILE and int as file descriptors.

8. RedHat4.0, BusLogic FlashPoint boot image and PPP configuration

9. Grabbing file from file descriptors

10. FILE descriptor and file id conversion?

11. difference b/w file pointer and file descriptor

12. kernel: Cannot read proc file system: 9 - Bad file descriptor

13. Fast way to write a file to a file descriptor or stream?