Particle's Custom RPG

PCRPG Development => Development => Topic started by: Hack-N-Slash on May 27, 2004 06:18 am CDT

Title: Server-Side Optimization
Post by: Hack-N-Slash 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.
Title:
Post by: Hack-N-Slash 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
Title:
Post by: -eViL- 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.
Title:
Post by: Hack-N-Slash 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.
Title:
Post by: -eViL- 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.
Title:
Post by: Hack-N-Slash on May 29, 2004 03:12 pm CDT
Ok, ok! *runs and hides*
Title:
Post by: UnderGod 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.
Title:
Post by: Hack-N-Slash 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.
Title:
Post by: UnderGod 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.
Title:
Post by: -eViL- 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.
Title:
Post by: Hack-N-Slash 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.
Title:
Post by: UnderGod 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.
Title:
Post by: Xanth 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?
Title:
Post by: Hack-N-Slash 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.
Title:
Post by: UnderGod on July 8, 2004 05:19 am CDT
Yeah... No fetchData, no RPG.
Title:
Post by: Xanth on July 8, 2004 10:07 am CDT
Yes, but it would run Hella-Fast yes?
Title:
Post by: UnderGod on July 8, 2004 03:42 pm CDT
It wouldn't run at all.
Title:
Post by: NukNuk on July 8, 2004 04:36 pm CDT
Xanth: So, hella fast?
Title:
Post by: WolfTones on July 8, 2004 04:40 pm CDT
Xanth: So, hella fast?= So very quick.







:)
Title:
Post by: Xanth on July 9, 2004 10:07 am CDT
Quote from: "WolfTones"
Xanth: So, hella fast?= So very quick.

:lol:
Title:
Post by: WolfTones on July 13, 2004 07:45 am CDT
Have to teach these people the way of the Xanth. If i don't noone will eh?
Title:
Post by: NukNuk on July 17, 2004 11:12 pm CDT
where can i look at the trpg source code?
Title:
Post by: Hersh on July 18, 2004 01:41 am CDT
scripts.vol
Search for a volumer on google to open it. All the code is in the *.cs files (use a text editor to open those).
-------
So...we remake rpg to be match games. (On time limit the server restarts everything goes back to zero.)  Then the server wouldn't need to save the character data. Now, how to do that and keep it fun...

Hersh
Title:
Post by: Hack-N-Slash on July 18, 2004 03:49 pm CDT
Anyone mind if my little fix breaks Deus Pack?  :lol: