user/memory/socket limit?

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
endquote
Posts: 35
Joined: 29 Dec 2006, 00:39
Location: Seattle, WA
Contact:

user/memory/socket limit?

Post 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?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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.
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply