Jump to content
  • Advertisement
Sign in to follow this  
md_lasalle

Game Server running slow on Linux!

This topic is 4215 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I'm currently porting the dedicated server for our game from win32 to linux. After fighting my way until it compiles and run... i get extremly slow response from the linux server. If i connect through LAN, i get like 700~900 ping. The game is setuped like this : - The main program is a console app waiting for input to interact with the game server - The game logic itself is spawned in a thread In win32, with default thread parameters, everything works perfectly. But i suspect that i'm not setting up my pthread accordingly for linux. Here is how i create the thread : pthread_attr_t threadAttr; //attribute for parameting the linux thread pthread_attr_init(&threadAttr); pthread_attr_setinheritsched(&threadAttr, PTHREAD_EXPLICIT_SCHED); pthread_attr_setstacksize(&threadAttr,4000); //reserving a 4 meg stack for the game pthread_attr_setschedpolicy(&threadAttr, SCHED_RR); sched_param schedparam; schedparam.sched_priority = 99; //if i put 100 here the thread doesnt work pthread_attr_setschedparam(&threadAttr, &schedparam); if(pthread_create( &threadID, &threadAttr,(PTHREAD_START_ROUTINE)pFuncter, pParam)) { perror("Thread Creation"); return false; } i even tried to run this as root to make sure it wasnt something interfering with my user rights. Thanks for any suggestions

Share this post


Link to post
Share on other sites
Advertisement
I would suggest that before you start twiddling the advanced-usgae settings you try just using the default thread parameters. Chances are good that the system will do a better job of scheduling if you let it.

On the other hand, ping times usually have nothing to do with server response time but rather measure network latency. Do you get the same response time problems if you;re running the client and server on the same machine through the loopback?

--smw

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!