Author Topic: Server-Side Optimization  (Read 8849 times)

0 Members and 3 Guests are viewing this topic.

Hack-N-Slash

  • Elvin Legion
  • *****
  • Posts: 492
  • Reputation: +0/-0
Server-Side Optimization
« on: May 27, 2004 06:18 am CDT »
The server has been doing a great job for the majority of the time, but as of late people slowdowns and crashes are becoming increasingly common. What can be done to resolve this without sacrificing the features we have already? The server connection seems to be enough for what we're doing, but the server seems to be choking on itself.

I'm writing down a list of considerations that I'll put down later today. All the questions will be aimed at possible server code optimizations.
« Last Edit: December 31, 1969 06:00 pm CST by Hack-N-Slash »
[size=200]I am a fat, wealthy, capitalist pig[/size]

Hack-N-Slash

  • Elvin Legion
  • *****
  • Posts: 492
  • Reputation: +0/-0
(No subject)
« Reply #1 on: May 27, 2004 07:46 am CDT »
1. What are the most called functions?

2. What functions take the most resources per call?

3. What has already been done to improve server efficiency?

I'll finish this later
« Last Edit: December 31, 1969 06:00 pm CST by Hack-N-Slash »
[size=200]I am a fat, wealthy, capitalist pig[/size]

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #2 on: May 27, 2004 11:41 am CDT »
if you want to solve all the problems of a tribes rpg server, you must kill GetAccessoryList();

but to do that, you must re-write lots and lots o code.
« Last Edit: December 31, 1969 06:00 pm CST by -eViL- »
There's nothing ever wrong but nothing's ever right
Such a cruel contradiction

Hack-N-Slash

  • Elvin Legion
  • *****
  • Posts: 492
  • Reputation: +0/-0
(No subject)
« Reply #3 on: May 28, 2004 06:22 am CDT »
Anything else? I'm going to browse thru the server code and look for areas for possible optimizations.

Are there any places where sorting is involved? I'd hate to see a freaking inefficient sort (bubble and the like) used all the time.
« Last Edit: December 31, 1969 06:00 pm CST by Hack-N-Slash »
[size=200]I am a fat, wealthy, capitalist pig[/size]

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #4 on: May 28, 2004 04:41 pm CDT »
hack, i told you the biggest problem in rpg, have a nice time finding anything bigger.

and just for the proof, i'll quote JI :

Quote from: "JI, from weight.cs"
//Replaces the laggy AddPoints(%clientId, 8) in RefreshWeight (the real lag comes from GetAccessoryList however)

JI put the lag into the mod, and never removed it even though he knew it was there.
« Last Edit: December 31, 1969 06:00 pm CST by -eViL- »
There's nothing ever wrong but nothing's ever right
Such a cruel contradiction

Hack-N-Slash

  • Elvin Legion
  • *****
  • Posts: 492
  • Reputation: +0/-0
(No subject)
« Reply #5 on: May 29, 2004 03:12 pm CDT »
Ok, ok! *runs and hides*
« Last Edit: December 31, 1969 06:00 pm CST by Hack-N-Slash »
[size=200]I am a fat, wealthy, capitalist pig[/size]

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #6 on: May 29, 2004 06:07 pm CDT »
Aside for the infinite loops that constantly run, and that function, there is nothing else that can really be fixed short of writing a special app to manage the server.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

Hack-N-Slash

  • Elvin Legion
  • *****
  • Posts: 492
  • Reputation: +0/-0
(No subject)
« Reply #7 on: June 3, 2004 01:27 pm CDT »
Wow, I just looked at getAccessoryList... frightening bit of code. Now I understand why you said that eViL: All those looped checks on player inventory.

I'm inclined to toy with it.

eViL, I also recall in the past hearing you say that fetchdata had an impact on the server as well.
« Last Edit: December 31, 1969 06:00 pm CST by Hack-N-Slash »
[size=200]I am a fat, wealthy, capitalist pig[/size]

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #8 on: June 3, 2004 02:33 pm CDT »
In a way it does, but there is nothing you can do about that short of rewriting the entire mod.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

-eViL-

  • Minotaur Rager
  • ******
  • Posts: 880
  • Reputation: +0/-0
(No subject)
« Reply #9 on: June 3, 2004 04:19 pm CDT »
what oz said. :P

but yes, fetchdata is a giant waste of server clock cycles.... it is called just about as much as the accessory list function is.
« Last Edit: December 31, 1969 06:00 pm CST by -eViL- »
There's nothing ever wrong but nothing's ever right
Such a cruel contradiction

Hack-N-Slash

  • Elvin Legion
  • *****
  • Posts: 492
  • Reputation: +0/-0
(No subject)
« Reply #10 on: July 7, 2004 01:51 am CDT »
Woot, my internet has finally come back to life! The service outage got me bored enough to probe more into this.



I wouldn't mind splitting fetchdata into separate functions and rewriting the code accordingly in order to kill that huge mess of if statements. The large if block would have to be a factor in the server's problems if fetchData is called so much.

If this doesn't fix the problem, it would definitely would reduce the time calling info from $ClientData

Either that or I call information from $ClientData whereever fetchdata is called.

If I'm going about this wrong, tell me what I would need to do, in exact terms. I have LOTS of time on my hands, and I need the practice anyways.  :wink:

If I get this fixed, I'll move on to dealing with getAccessoryList.
« Last Edit: July 7, 2004 10:23 am CDT by Hack-N-Slash »
[size=200]I am a fat, wealthy, capitalist pig[/size]

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #11 on: July 7, 2004 05:21 am CDT »
The best way to rewrite something like the character saving function, is to turn it into 1 quick line of code that still saves everything.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

Xanth

  • Minotaur Rager
  • ******
  • Posts: 760
  • Reputation: +0/-0
(No subject)
« Reply #12 on: July 7, 2004 11:15 am CDT »
Is is just possible to leave the FetchData calls in and just replace the function with and empty function that does nothing?
« Last Edit: December 31, 1969 06:00 pm CST by Xanth »


Currently playing BF2
(Name: Xanth-911 ) BooYa!!

Hack-N-Slash

  • Elvin Legion
  • *****
  • Posts: 492
  • Reputation: +0/-0
(No subject)
« Reply #13 on: July 7, 2004 01:42 pm CDT »
If you want to break the mod...sure.  :?

The function is used to call character information from the server.
« Last Edit: December 31, 1969 06:00 pm CST by Hack-N-Slash »
[size=200]I am a fat, wealthy, capitalist pig[/size]

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #14 on: July 8, 2004 05:19 am CDT »
Yeah... No fetchData, no RPG.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"