Author Topic: More Scalable Server Query  (Read 191 times)

chrischoo

  • Hydlaa Resident
  • *
  • Posts: 151
    • View Profile
More Scalable Server Query
« on: January 22, 2004, 10:09:20 am »
I notice that right now, the server status page uses PHP to perform a server query at port 13333. From previous experience I feel that using PHP to perform queries dynamically is not going to be a good idea in high-traffic scenarios.

What I suggest is that Port 13333 only listen to local queries, and that a script that generates a static HTML page concerning the server status of PlaneShift be done instead. The script could be run every minute, with the HTML file included in pages such as this forum, and on planeshift.fragnetics.com

I have a few reasons for this:
1) In high-traffic scenarios the web-server is not going to be able to handle requests efficiently. We noticed this during the times when we were Slashdotted in 2002 and 2003. We decided to make our webpages static as far as possible to prevent this from happening again in future.

2) This prevents possible DoS attacks on port 13333. I\'m not sure if the main PlaneShift port can be attacked easily, but limiting the queries to local users or a restricted list of remote users seems like an ok idea to me.

3) Overall decreased load on the PS Server, which listens to the query port at 13333 apart from running the main PlaneShift game itself. Our web server would also become slightly more responsive.

I see 3 simultaneous connections to the query port this moment.

Devs what do you think?
« Last Edit: January 22, 2004, 10:10:58 am by chrischoo »

acraig

  • Administrator
  • Veteran
  • *
  • Posts: 1562
    • View Profile
(No subject)
« Reply #1 on: January 22, 2004, 02:57:36 pm »
Yes, that is exactly what I was thinking as well.  I would like to set up a cron job that runs every 10 minutes or so that would talk to the server on the TCP port and create a static html that would have things like number/current players/loads/etc.

I was not too concerned about it at the moment since there is not too much traffic on it.  But you are right in that a) it decreases the load on the server b) prevents people from hammering the server by making it try to answer all those TCP requests.  

I am going to work on the TCP server status part of PlaneShift sometime soon and will be making these changes.  I\'m hoping that this will be the start of our data mining process as well to see how things are going in game and what areas we will need to tweak.
----------
Andrew
"For all I know, she's lying, everyone's lying; welcome to the Internet"