1400 connected then 900 using TCP/IP

Started by
14 comments, last by KalvinB 21 years, 9 months ago
quote:Original post by KalvinB
I'll keep looking into IOCP. The more I think about it though, the more it makes sense to just limit the max connections to around 1000 and run a lobby. The server could handle 10,000 connections I'm sure but the amount of game logic that would need to be processed would bring the CPU to a halt. It's entirely possible to run multiple instances of the server on the same computer.


Still, even with "only" 1000 connections, your select would be taking a pretty big slice of the CPU. You'd be surpised at the speed improvement, even with small numbers of users, that I/O CPs can give you. Plus it means you're nice and scaleable if you ever decide to get a dual CPU machine

Edit: By the way, there used to be a really good I/O Completion Port sample in the Platform SDK (it was actually a POP3 server) but it's not in the newest one (which I've got). I think we got a few older sdks at work, so I'll have a look for it when I go there, but if you can get your hands on an older Platform SDK (like one from last year or so), have a look in the "\Samples\netds\WinSock" folder for a POP3 sample. It's really good - better than the iocp sample I don't know why they got rid of it...

codeka.com - Just click it.

[edited by - Dean Harding on June 24, 2002 9:50:50 PM]
Advertisement
That''d be good to have. If the older examples are not readily available on-line anywhere I''d like to get them posted at my site.

Ben


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting ]
quote:Original post by KalvinB
That''d be good to have. If the older examples are not readily available on-line anywhere I''d like to get them posted at my site.


I''m not going in to work until Thursday, so if I find it, I''ll mail it to you then. I don''t know why it''s not in the latest SDK, I mean, it''s not out of date or anything...

codeka.com - Just click it.
with 1000 connections things like connection timeouts can occer. i assume the test client is on a different pc, and not running on the server, if not there could be your problem. if your going over the net, it could be your isp delibratly block packets due to the flurry of (100s of) connections being made (ids software may think its a DOS attack or portscan). try increasing the time between connections. also check your code, make sure your handling everything correctly. its quite possible your client is mishandling connections.

try threading connections (ie maybe 64 per thread). this allows better multitasking.

win2kpro may be block packets as well due to the flurry of connects (all from the same ip). the output window will be delayed due to cpu overhead generated actually processing requests. thus it only seems to stall, but its the flurry of printfs (or whatever output log function is called) that stalls the server. make sure it only prints a few line per second, or writes to a file. the console can be slow to update at times.

also, most routers ussually have some simple packet filtering, thus can be set to limit tcp syn packets or other things based on the packet. you can do this using linux as a router, and i am sure most "firewalls/routers in a box" designed to share connections at home handle this. which probably means an isp would be using software similar to this as well to help ensure smooth sailing for their network.
I''ve uploaded the POP3 sample I was talking about to:

www.codeka.com/tmp/pop3.zip

This is what I used when I was learning I/O CP, so it can''t be all bad

codeka.com - Just click it.
Cool, thanks

Ben


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting ]

This topic is closed to new replies.

Advertisement