Subject: "Sockets. CF limit on connections?" Previous topic | Next topic
Printer-friendly copy Email this topic to a friend CF Website
Top Non-CF Discussion "What Does RL Stand For?" Topic #975
Show all folders

TheDudeFri 26-Jan-07 09:09 PM
Member since 20th Sep 2005
285 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#975, "Sockets. CF limit on connections?"


          

I am generally curious, how many connections could CF realistically handle, in terms of it's server's socket connections?

I ask because I am doing some load testing on a c++ socket server I'm writing (totoally non-mud related) and am wondering what sort of numbers the mud server could physically theoretically handle before connections started getting blocked (as a comparison); I'm hoping to get an answer independent of what overall program memory might allow, for simplicity's sake.

Also, what platform is CF run on?

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

Reply RE: Sockets. CF limit on connections?, Isildur, 28-Jan-07 05:24 PM, #1
     Reply I thought every socket was a file descriptor on Solaris, Theerkla, 28-Jan-07 07:20 PM, #2
          Reply RE: I thought every socket was a file descriptor on Sol..., Isildur, 28-Jan-07 07:41 PM, #3
               Reply Thanks. Both of you seem to be on it., TheDude, 30-Jan-07 12:52 AM, #4
                    Reply Probably aren't going to get that info about CF, Tac, 30-Jan-07 09:12 AM, #5
                    Reply Not really.., Marcus_, 30-Jan-07 11:12 AM, #7
                         Reply RE: Not really.., Isildur, 30-Jan-07 06:53 PM, #8
                              Reply But that would be multiplaying, which is wrong and agai..., Marcus_, 05-Feb-07 07:12 AM, #9
                    Reply RE: Thanks. Both of you seem to be on it., Isildur, 30-Jan-07 10:45 AM, #6

IsildurSun 28-Jan-07 05:24 PM
Member since 04th Mar 2003
5969 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#978, "RE: Sockets. CF limit on connections?"
In response to Reply #0


          

IIRC it runs on Solaris. Which probably means the OS isn't the limiting factor on how many simultaneous connections it can handle.

I think the theoretical max for TCP/IP is 65535.

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

    
TheerklaSun 28-Jan-07 07:20 PM
Member since 04th Mar 2003
1055 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#979, "I thought every socket was a file descriptor on Solaris"
In response to Reply #1


          

Which would mean there's a configuration setting that limits how many open sockets you can have assuming you haven't altered the defaults.

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

        
IsildurSun 28-Jan-07 07:41 PM
Member since 04th Mar 2003
5969 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#980, "RE: I thought every socket was a file descriptor on Sol..."
In response to Reply #2


          

That might be the case. When I said the OS isn't the "limiting factor", I meant that your app is more likely to have a problem adequately handling pathologically large numbers of sockets than Solaris is. (This, contrasted with Windows, which sort of barfs when you try to open too many sockets, or open & close them at too high a frequency).

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

            
TheDudeTue 30-Jan-07 12:45 AM
Member since 20th Sep 2005
285 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#981, "Thanks. Both of you seem to be on it."
In response to Reply #3
Edited on Tue 30-Jan-07 12:52 AM

          

I'm running on Mac OS X right now. Theerkla's correct- the sockets are file descriptors and there's a setting to up the default from, I believe, 512. Supposedly the default is dynamically upped when more sockets are requested, but I've not gotten my server to handle more than a hard limit of ~500. No worries though, this is plenty for now so I haven't forced the issue.

And yep Isildur, my whole world starts slowing down when I reach the limits so I'm keeping it under 500 until if and when I need to boost my hardware/code to accomodate. It's a CPU cycle bottleneck with some 500 threads going on (i.e. my application/hardware) not a socket issue, per se. So at the end of the day I've got a strong feeling that my code/hardware's going to be the limiting factor, not the socket limitations..as you warned. I'm happy with that.

Thanks!

(still curious how many connections CF could handle though, har).

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

                
TacTue 30-Jan-07 09:12 AM
Member since 15th Nov 2005
2050 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#982, "Probably aren't going to get that info about CF"
In response to Reply #4


          

Since I imagine it could be used in a DoS attack. Not that you would, or that you'd need the info to launch such an attack, but there it is.

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

                    
Marcus_Tue 30-Jan-07 11:03 AM
Member since 04th Mar 2003
681 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#984, "Not really.."
In response to Reply #5
Edited on Tue 30-Jan-07 11:12 AM

          

If somebody were to try SYN flooding cf (i.e. opening sockets until cap is reached or all resources are drained), it's a different number than the actual max number of connections.

In those kinds of DoS attacks, you spam-create half-open connections until that specific queue is filled up, and it becomes difficult for new players to connect. The already connected players can, however, stay on. So there's a specific number for half-open connections.

As for the original question: Depends on what OS the cf box is running. If it's solaris, there are two possibilities:
32-bit solaris = 256 connections
64-bit solaris = 65k limit by OS

The server probably runs either solaris 64 or linux, which would put max connections somewhere in the 5-digit range (guesstimation).

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

                        
IsildurTue 30-Jan-07 06:53 PM
Member since 04th Mar 2003
5969 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#985, "RE: Not really.."
In response to Reply #7


          

That's a DoS against the box on which CF runs. A DoS against CF would be to create a bunch of level-1 characters until the mud code either crapped out or started rejecting new logins.

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

                            
Marcus_Mon 05-Feb-07 07:12 AM
Member since 04th Mar 2003
681 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#995, "But that would be multiplaying, which is wrong and agai..."
In response to Reply #8


          

yeah yeah it's bad

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

                
IsildurTue 30-Jan-07 10:45 AM
Member since 04th Mar 2003
5969 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#983, "RE: Thanks. Both of you seem to be on it."
In response to Reply #4


          

Are all the sockets active? It's surprising that your server would completely bog down as you approach the limit unless it's an OS issue.

Are you polling them in a tight loop? If so, that's probably a bad idea. If you're not already, try using something like select(), which blocks until some number of your sockets are ready for reading. When it returns, you service those sockets that are ready, then call select() again.

Check out the man page. (I'm assuming OSX comes with man pages.)

  

Alert | IP Printer Friendly copy | Reply | Reply with quote | Top

Top Non-CF Discussion "What Does RL Stand For?" Topic #975 Previous topic | Next topic