0

In the example of stream3.c, there is a pipe(fd) command producing two file descriptors, fd[0] and fd[1].
This script keeps on running by the wake_up(argv, fd[0], WK_FD) command.
That means every server-push script uses 2 file descriptors.

Who can tell:

  • What if there are 100,000 active and long lasting running scripts as above, or even more?
  • Would it run out all file descriptor?
  • How many stystem resouces are held for keeping the connections active?
Jonathan
  • 20,053
  • 6
  • 63
  • 70
k.k. lou
  • 1,805
  • 2
  • 13
  • 16

1 Answers1

0

That means every server-push script uses 2 file descriptors.

No. See the comet.c example for a server-push script that does not use additional file descriptors.

The stream3.c script acts as a client (to call a backend server or system pipe) in addition to generating contents for a remove client.

There's no way to do that without a new file descriptor.

What if there are 100,000 active and long lasting running scripts as above?

G-WAN would allocate the necessary resources.

Would it run out all file descriptor?

No.

How many stystem resouces are held for keeping the connections active?

Establish 10 connections and see how much resources have been allocated. Divide this number by 10 to find the overhead by connection.

Gil
  • 3,279
  • 1
  • 15
  • 25
  • must add that on most default installations of linux this WILL effectively run into ulimit, FD_SETSIZE and the like before reaching 100k, but if it does, it's not an issue of GWAN, so you might want to add that to the answer (so people don't mistakenly blame GWAN when they reach ulimit). At least, if I'm not mistaken some different limits there (I won't call myself expert, so it's fine) ;) – griffin Jul 03 '13 at 16:27
  • 1
    In daemon mode, G-WAN already raises those limits to a higher level, see your gwan.log file. – Gil Jul 04 '13 at 11:29