Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : The Site : Webserver load
New Topic New Poll Post Reply
Poster Message
Syntax
Level: Smitemaster
Rank Points: 1218
Registered: 05-12-2005
IP: Logged
icon Webserver load (+1)  
I've only really noticed this recently (last few weeks), as in it's only recently really been bothering me, but it seems the site response has become extremely slow. Most of the time, once the host has been reached, the page loads extremely quickly. The lag seems to be to do with the original request getting ack'd.

Things will be smooth for, say, an hour and the no pages will reload for for a good few minutes. I know bandwidth is expensive etc but just wanted to make sure it wasn't something done locally ie am I being throttled or some such for taking too much throughput? I started noticing the slowdown (ironically) when I upgraded to 24Mb.

My other thought (due to the actual page download being fast and just the connection stalling) was that the listener pool was being filled up. Pages such as misc tab could therefore be blocking a thread and could trigger the pool filling quickly.

I also get this in-game, with more and more score upload resulting in "Uploading room demo" for a minute or more - I had never seen this message before unless my ISP had actual dropped my connection. I've yet to be disconnected with this new ISP.

Basically, I'd just like some thoughts on this, and if it is something like throttling, I'd like to configure things this end so it stops happening.

If it is bandwidth/server load, I'd gladly contribute toward any required upgrade.
10-17-2007 at 07:11 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
larrymurk
Level: Smitemaster
Avatar
Rank Points: 1916
Registered: 12-09-2004
IP: Logged
icon Re: Webserver load (0)  
I've noticed in the last week that there are annoying delays while playing drod (assumedly handling high scores/demos).
10-17-2007 at 07:55 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Elfstone
Level: Smitemaster
Avatar
Rank Points: 1285
Registered: 03-01-2006
IP: Logged
icon Re: Webserver load (0)  
Ahaa! now I had noticed something strange along these lines recently, but I just assumed it was me (I always asume it's my computer, or rather my use of it, that's wrong). Just in the last day or so it has taken ages, sometimes, for some pages on the site to load - but not all of them, which is even odder. Still on dial-up here, so things take a while anyway, but there has been a noticeable difference.

____________________________
Winner of: Novice Architect Excellence 2006.
FAPCA - Technical Design Excellence in Layout and Aesthetics

10-17-2007 at 08:41 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
Remlin
Level: Master Delver
Rank Points: 181
Registered: 04-28-2005
IP: Logged
icon Re: Webserver load (0)  
When I play at night (PST), I disconnect from caravelnet. Otherwise too many random slowdowns for me to deal with.
10-17-2007 at 09:01 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Mattcrampy
Level: Smitemaster
Avatar
Rank Points: 2388
Registered: 05-29-2003
IP: Logged
icon Re: Webserver load (0)  
I've heard rumours that it has to do with problems with the highscore spider, but I can't say anything for sure.

____________________________
What do you call an elephant at the North Pole?
Click here to view the secret text

10-18-2007 at 03:00 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5413
Registered: 02-04-2003
IP: Logged
icon Re: Webserver load (0)  
Syntax, it has nothing to do with you being throttled - at times, the server is just really overloaded. 99% of the time, this has to do with highscores. The highscores page (not the spider) puts some extreme stress on the server.

I've got a several-step plan to reduce the load put on the server due to the highscores page. It's in progress right now, but the first step involves re-verification of a LOT of demos, so it's going to be a long step.

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
10-18-2007 at 03:11 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
Stephen4Louise
Level: Smitemaster
Avatar
Rank Points: 548
Registered: 04-06-2005
IP: Logged
icon Re: Webserver load (0)  
Schik wrote:
Syntax, it has nothing to do with you being throttled - at times, the server is just really overloaded. 99% of the time, this has to do with highscores. The highscores page (not the spider) puts some extreme stress on the server.

I've got a several-step plan to reduce the load put on the server due to the highscores page. It's in progress right now, but the first step involves re-verification of a LOT of demos, so it's going to be a long step.
Has there been any consideration given to having a dedicated high scores server?

Steve.
10-18-2007 at 08:47 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Webserver load (+1)  
Stephen4Louise wrote:
Has there been any consideration given to having a dedicated high scores server?
I think this is one of the cases where "improve the algorithm" will mop the floor with "throw more hardware at it"...

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(
10-18-2007 at 09:20 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Syntax
Level: Smitemaster
Rank Points: 1218
Registered: 05-12-2005
IP: Logged
icon Re: Webserver load (0)  
Schik wrote:
Syntax, it has nothing to do with you being throttled - at times, the server is just really overloaded. 99% of the time, this has to do with highscores. The highscores page (not the spider) puts some extreme stress on the server.
Thanks for clarifying that :)

Why not use a temp table in the meantime, refreshed every x mins? Either way, I'll try and keep away from that page for now :)

10-18-2007 at 10:14 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Insane
Level: Master Delver
Avatar
Rank Points: 154
Registered: 08-06-2005
IP: Logged
icon Re: Webserver load (-1)  
I'm sure you've all thought of this before, but here are a few suggestions from a coder's point of view:
To reduce stress on the highscore page:

1) Cache it and check for version number only, so you don't re-download the whole table each time, only if the version number has increased. (Or last-changed date)

2) Make sure it isn't an http download, but make a custom protocol that requires far less bytes.
Example:

>> GETVER 12050125 21
   (command) (hold) (room)
<< 0000013
   (version)
|| Check for version mismatch
>> GETFUL 12050125 21
<< *data*

It's a matter of a few bytes that get spared, but remember - multiplication can create powerful numbers.
We're talking.. maybe a thousand requests a day? (I don't know!)

3) Of course this is essential in improving data travel, make a really compact way of transferring the data.
Instead of transferring, say, an html file, transfer compact data and then parse it to an html file.

Example, Replace:
<html><body><table>
<tr><td>Name</td><td>Score</td></tr>
<tr><td>Blah</td><td>12345</td></tr>
<tr><td>xyz</td><td>1337</td></tr>

With:
Blah(NUL)12345(NUL)
xyz(NUL)1337(NUL)

This saves loads of bandwidth too.

Now I'm sure most if not all of these have already been thought about, and probably even implemented, but I'm just re-recommending it.

-Insane
10-18-2007 at 11:32 AM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Webserver load (+1)  
Insane wrote:
I'm sure you've all thought of this before, but here are a few suggestions from a coder's point of view[...]
Ummm... this is about the highscores page here on the forum (you know, the one that lists the top ranked players) producing a lot of load since it's database request probably aggregates info about all existing demos to produce it's results.

It surely isn't about the highscore requests or demo submissions made by the game itself; I'm not sure optimizing those would make much of a difference.

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(
10-18-2007 at 11:45 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Syntax
Level: Smitemaster
Rank Points: 1218
Registered: 05-12-2005
IP: Logged
icon Re: Webserver load (0)  
Briareos wrote:
Ummm... this is about the highscores page here on the forum (you know, the one that lists the top ranked players) producing a lot of load since it's database request probably aggregates info about all existing demos to produce it's results.
Yeah that was my understanding too
10-18-2007 at 11:59 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Insane
Level: Master Delver
Avatar
Rank Points: 154
Registered: 08-06-2005
IP: Logged
icon Re: Webserver load (0)  
Hmm, seems I mis-understood something there.
For the website I also recommend just caching it, and re-parsing all 5 minutes, or every 50 changes (that way it only re-parses if a lot has change).

If possible, perhaps just re-parse those pages that receive a notable change when something is updates, and then one could still make it change all 10 updates.
Of course you'd either have to cache every single of the many html pages, or just cache the data into a database and read from that instead of re-parsing the whole player data.

-Insane

Ps: If there ever is a problem with server bandwidth, it's of course recommendable to try above suggestions anyways.

[Last edited by Insane at 10-18-2007 12:26 PM]
10-18-2007 at 12:24 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1309
Registered: 11-24-2005
IP: Logged
icon Re: Webserver load (0)  
The word is "cache". Cache SQL queries like there's no tomorrow. I'd point you at PHPBB3, but I don't know whether you guys want a GPL'd forum (for obvious reasons)
10-18-2007 at 03:21 PM
View Profile Show all user's posts Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Webserver load (+1)  
coppro wrote:
The word is "cache". Cache SQL queries like there's no tomorrow. I'd point you at PHPBB3, but I don't know whether you guys want a GPL'd forum (for obvious reasons)
I really don't think Schik would be willing to port any part of the site to another forum software - and what for?

All those pages that are handling the website, CaravelNet et al are surely written from scratch, and the forum software itself is heavily modified.

EDIT: I mean, it's not simply grabbing data straight out of the database that's slow (like rendering a thread here), but it's those queries that calculate stuff (like the highscores page), so caching those helps most.

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(

[Last edited by Briareos at 10-18-2007 03:42 PM]
10-18-2007 at 03:39 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5413
Registered: 02-04-2003
IP: Logged
icon Re: Webserver load (0)  
Sigh.

Does PHPBB3 have support for our highscore system, but in a more optimized fashion?

I appreciate all the interest, but the main factor for me is not coming up with ideas for how to optimize things, but coming up with time to implement these ideas. And not screw up the highscores in the meanwhile.

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
10-18-2007 at 03:52 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
Remlin
Level: Master Delver
Rank Points: 181
Registered: 04-28-2005
IP: Logged
icon Re: Webserver load (+4)  
A temporary but quick partial fix might be to make the landing page when you click on High Scores be My Stats, instead of Players. 90% of the time I click on High Scores I'm not actually interested in the Players tab, and it's a shame I have to put the server through the trouble of loading it when it seems to be much more expensive than loading My Stats. If other people are like me, that's a lot of unnecessary load.
10-18-2007 at 04:10 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
coppro
Level: Smitemaster
Rank Points: 1309
Registered: 11-24-2005
IP: Logged
icon Re: Webserver load (0)  
Schik wrote:
Does PHPBB3 have support for our highscore system, but in a more optimized fashion?
I was referring to the caching system for queries. No, they don't have support for the highscore system, but they have this clever system of caching data into a file by creating a hash from the query and storing the results in a file named according to hash, and the file is actually a php script that sets some variables to the results of the query. That way, you just can just include the results (with the function) and you are good. A little more playing around gets you a system of keeping track when a table has changed and which queries access which tables and whatnot (the DBAL that phpBB3 uses helps in this regard - they have to parse all the queries anyway, so extracting the tables accessed is easy). That way you never retrieve out-of-date information.
10-18-2007 at 11:15 PM
View Profile Show all user's posts Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5413
Registered: 02-04-2003
IP: Logged
icon Re: Webserver load (0)  
Ah. I've got my own homegrown caching system. I only turn it on for specific queries, however. In my testing, turning it on for various highscores queries did nothing unless you sat there and refreshed the page multiple times in immediate succession. The highscores change frequently enough that generic caching was useless - at least if we want the highscores page to be 100% current.

I've got some more specialized caching in mind if I can't get performance to an acceptable place with the first few things I optimize.

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
10-18-2007 at 11:31 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2486
Registered: 09-10-2004
IP: Logged

File: mybad.jpg (88.7 KB)
Downloaded 253 times.
License: Public Domain
icon Re: Webserver load (0)  
I haven't used this in a while, but I'm guessing this isn't too good. :blush

sorry!

Click here to view the secret text


[Last edited by Rabscuttle at 10-19-2007 01:00 AM]
10-19-2007 at 12:57 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5106
Registered: 02-04-2003
IP: Logged
icon Re: Webserver load (0)  
All this talk about "throttling" people who load the scores pages too often brings funny images into my mind :P

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
10-19-2007 at 05:34 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Webserver load (0)  
mrimer wrote:
All this talk about "throttling" people who load the scores pages too often brings funny images into my mind :P
I've written this nifty throttling valve for Tomcat that drops the connection if there's too many concurrent requests from a single IP in a given timeframe - anybody interested?

It's a wee bit Tomcat-specific, though... :D

But it does wonders against jokesters that hold down F5 while having loaded one of our dynamically generated intranet pages in their Intranet Exploder - which, I have to say, is a good if evil test for just about any webserver; hold down F5 for a few seconds and look how long it takes for other requests being served again afterwards... :fun

(Not that I would suggest doing this here, or on any other website you're not responsible for...)

np: Underworld - Glam Bucket (Oblivion With Bells)

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(

[Last edited by Briareos at 10-19-2007 10:09 PM]
10-19-2007 at 10:09 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Webserver load (0)  
Schik wrote:
I've got some more specialized caching in mind if I can't get performance to an acceptable place with the first few things I optimize.
Saaay... has the highscores page gotten quite a bit faster, or have I gotten slower? :)

And no, I mean the "Players" page, not the "My Scores" page it defaults to now... :D

Also, - ~426000 demos? That's gonna take a while...

np: Underworld - Best Mamgu Ever (Oblivion With Bells)

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(

[Last edited by Briareos at 10-20-2007 12:15 PM]
10-20-2007 at 12:10 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5413
Registered: 02-04-2003
IP: Logged
icon Re: Webserver load (+1)  
Indeed it has. I got tired of waiting for step 1 to finish, so I worked on step 2. It made a considerable difference, but there's still a lot of room for improvement.

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
10-20-2007 at 01:47 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
jamie
Level: Smiter
Rank Points: 365
Registered: 04-15-2005
IP: Logged
icon Re: Webserver load (+2)  
step 3: PROFIT!

/me gets my coat


And picking up on something 'insane said earlier'. And I'm talking generally, and not relating any of this to the caravelnet server (after all, schik is the one who knows what is what there, and he's on top of things, so I don't think any of us can actually comment) :

instane wrote:

2) Make sure it isn't an http download, but make a custom protocol that requires far less bytes.
Example:

quote:

>> GETVER 12050125 21
(command) (hold) (room)
<< 0000013
(version)
|| Check for version mismatch
>> GETFUL 12050125 21
<< *data*


I totally disagree there - any 'cost' on the 'request' side (if any) would be based on setting up the tcp connection, and allocating a process to deal with it.

The saving on a few bytes - (especially as a http request would fit into a single packet anyway) would really make no difference.

EVEN WORSE:

Your example above requires 2 requests. Http already has the "if-modified-since" request type, where in ONE request, data can be requested "if modified since xxxx" - the response is either the data, or a code saying "you already have the latest copy"

Ok, you could modify your example to have similar, but the slightly more verbose http protocol would really not cause any problems -- any problems would be relating to the reply data, not the request/reply format!



____________________________
#f3i2g# Disclaimer: I'm Welsh, left-handed, and stupid. #f3i2g#

[Last edited by jamie at 10-20-2007 05:05 PM]
10-20-2007 at 05:04 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : The Site : Webserver load
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.