Skip to main content
GameDev.net gamedev.net
🔒 Locked

Server programming techniques

Started by Garfong Sep 8, 2003 at 4:05 PM 1 replies 850+ views
Original Post
Garfong
Garfong
I''m looking at programming something (which from a network perspective anyway) looks basically like a massivly multiplayer RTS game. What kind of thing would be best here? I''d been thinking of a preforking server, with the processes communicating through a database. I''m worried though that the complexity of a preforking server would be too much to offset the gain in efficiency over forking as connections are received, especially since unlike http each process is probably going to be pretty long-lived. I''m also somewhat concerned that the database will be too slow, however I don''t think this is an issue... Does this sound reasonable, or is there a better way? Any comments appreciated.
JonStelly
JonStelly
I''m assuming since you''re talking about forking that your target server platform is Linux / Unix? If it''s Linux I''d look into pthreads instead of forking. Your description of your game isn''t detailed enough for me to give much advice on server architectures beyond that.
fingh
fingh
Generally, you don''t want a thread per connection architecture, you will quickly overwhelm the system. If you feel you NEED a threaded network architecture (generally you don''t), then use a thread pool such that you can have several/many connections on each thread in the pool.

Also, you don''t want to maintain world state through any RDBMS. You are correct, it is FAR too slow for this type of application. It''s okay for non real-time stuff like log in, logout/save etc... but for live game state data management you would spend half of your CPU time waiting on the database rather than processing cool game stuff like AI.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.