Page 1 of 1

user/memory/socket limit?

Posted: 29 Jun 2007, 01:25
by endquote
My game is crashing when it hits a certain number of users. When I hit about 100 simultaneous games and about 300 connected users, I get this error infinitely until I kill the Smartfox process.

Code: Select all

[ WARNING ] > error during accept(): java.io.IOException: Too many open files
I'm wondering if there is some sort of limit on socket connections that I need to increase. In addition to using connections for users, I am also using LoadVars to hit an external PHP script frequently during games. I'm wondering if the connections being opened by LoadVars are not being closed for reuse?

Posted: 29 Jun 2007, 04:49
by Lapo
You're running under Linux, I suppose.
The problem is with the config of your OS. Linux treats both socket connections and files as "file descriptors" and by default allows a maximum of 1024 "files" open at the same time.

You can check the limit in your OS by typing this in the terminal:

Code: Select all

ulimit -n
and you can change it with:

Code: Select all

ulimit -n YourNumberGoesHere
Make sure you run SmartFoxServer under the same user you used for changing the limit

hope it helps

p.s. = If you logout the change will be lost.
if you are a little familiar with the Linux shell you can alter the sfs script to incorporate that ulimit command.