Buy Brownie Points
Forumwarz is the first "Massively Single-Player" online RPG completely built around Internet culture.

You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.

You need to be logged in to post and to see the uncensored versions of these forums.

Log in or Learn about Forumwarz

Civil Discussion
Switch to Role-Playing Civil Discussion
Bug - 3 Site lag = ridiculous

Nut Buster

Avatar: Middle Finger

Level 29 Troll

“Gaping Asshole”

Ok I can understand some site lag, it’s been happening since Episode 2 came out. But now it’s just ridiculous. Can we get a server reboot or something? I was just in Wiccapedia pwning the final thread, and when I hit the attack, it took forever, and then came to the “You’ve exited the forum” page saying if I took longer than 60 minutes this happens. Well I didn’t exit on my own accord, and I didn’t take 60 minutes (roughly 90 seconds). Something needs to be done about this, I know you can’t afford new servers, but maybe something like cleaning out the server space or streamlining the game.

Edit: Also… I just noticed this… I got all the damage to my equipment from this… but none of the experience… I can’t tell on .moar files…. I also didn’t waste a forum visit… the oddities acgreat timesulate.

Nut Buster edited this message on 11/06/2008 7:26PM

SimplyTHEBEST

Avatar: Rocker Chick
17

Level 69 Camwhore

“Venereal Biohazard”

If I knew what they were running and how it was set up I might be able to help them get a bit more oomph out of what they have. Barring that, I could help them make careful decisions about what they should buy to get the most bang for their buck.

Out of everything, the only part of forumwarz that actually suffers when lag steps in is pwning threads. bumuming that they’re running a single-server solution, I would suggest sticking the pwnage system on it’s own server and storing all forum data on a RAMDisk.

7VibratingLa-
ngston

Avatar: 64688 Sun Oct 19 21:42:40 -0400 2008
3

[To Your Scattered -
Raepdogs Go
]

Level 33 Troll

“Permafail”

Image attacks are laggy. But the lag is not that bad. The rest of the problems are only happening to you.

SimplyTHEBEST

Avatar: Rocker Chick
17

Level 69 Camwhore

“Venereal Biohazard”

I get ‘Refreshing the page will not cost you a forum visit’ messages just about every time I go and pwn a forum. It doesn’t matter what computer I use, what network I’m on, or what ISP I’m connected through.

I’d say that’s pretty bad.

Nut Buster

Avatar: Middle Finger

Level 29 Troll

“Gaping Asshole”

Yea I’ve tried it on my laptop and PC, as well as local library computers. It’s not just me…

Tig O-Bitties

Avatar: 24201 Thu Nov 06 12:02:31 -0500 2008
6

[The Flamers of Loa-
thing
]

Level 33 Camwhore

“Courte-chan”

SimplyTHEBEST Posted:

I get ‘Refreshing the page will not cost you a forum visit’ messages just about every time I go and pwn a forum. It doesn’t matter what computer I use, what network I’m on, or what ISP I’m connected through.

I’d say that’s pretty bad.

Same here. I have to refresh each forum after almost every attack.

200KillerWas-
ps

Avatar: 28280 Fri Dec 12 03:48:27 -0500 2008
11

Level 37 Troll

Don't caek me bro!

what

200KillerWas-
ps

Avatar: 28280 Fri Dec 12 03:48:27 -0500 2008
11

Level 37 Troll

Don't caek me bro!

lag are

200KillerWas-
ps

Avatar: 28280 Fri Dec 12 03:48:27 -0500 2008
11

Level 37 Troll

Don't caek me bro!

you talking

200KillerWas-
ps

Avatar: 28280 Fri Dec 12 03:48:27 -0500 2008
11

Level 37 Troll

Don't caek me bro!

about?

FalconFour

Avatar: 69421 Wed Aug 12 05:13:59 -0400 2009
6

Level 35 Troll

Minty Fresh

7VibratingRaepdogs Posted:

Image attacks are laggy. But the lag is not that bad. The rest of the problems are only happening to you.

Image attacks, any attacks, they’re all the same. The problem is in the time it takes to process the AJAX request and receive a result from the server-side processing of damage, pwnage level, stats, etc… all that **** is processed on the server on each action. Unlike a traditional website, only small portions of the page are sent and received, but the server still does the processing on nearly every action during a “battle”.

Maybe, for some freakish and unusual reason, you’ve never seen the “greyed out lockup” after performing an action with the “pinwheel” spinning and waiting for a response. And I also imagine you’ve never seen the “An error occurred while communicating with the Forumwarz server – try refreshing the page” (paraphrased from memory) message that happens when a request times out.

And yes, the lag is pretty damn bad at times. It makes speedrunning damn near impossible. It’s not a problem with my computer either – it was on my original 866MHz P3 laptop that I originally played Forumwarz on, but not so much on the Core Duo laptop I use now.

I imagine there is much room for improvement. MySQL (which Trout says that Forumwarz uses) has a rather useful “Memory” table type that can be used for temporary tables that are rapidly written, and could help relieve some of the load, if it’s not already being used here in some way. Apache (especially under Linux) makes administration pretty “blind”, but you can probably find some pretty slick tools to show you where the bottleneck is. And as one user had already mentioned, there are people that can help pick better hardware or make better use of it… I’m all for one-server solutions (they’re far more efficient at processing data), and I imagine one server can continue to do everything, just with a little tweaking. Log in to see images!

200KillerWas-
ps

Avatar: 28280 Fri Dec 12 03:48:27 -0500 2008
11

Level 37 Troll

Don't caek me bro!

FalconFour Posted:

Image attacks, any attacks, they’re all the same. The problem is in the time it takes to process the AJAX request and receive a result from the server-side processing of damage, pwnage level, stats, etc… all that **** is processed on the server on each action. Unlike a traditional website, only small portions of the page are sent and received, but the server still does the processing on nearly every action during a “battle”.

Maybe, for some freakish and unusual reason, you’ve never seen the “greyed out lockup” after performing an action with the “pinwheel” spinning and waiting for a response. And I also imagine you’ve never seen the “An error occurred while communicating with the Forumwarz server – try refreshing the page” (paraphrased from memory) message that happens when a request times out.

And yes, the lag is pretty damn bad at times. It makes speedrunning damn near impossible. It’s not a problem with my computer either – it was on my original 866MHz P3 laptop that I originally played Forumwarz on, but not so much on the Core Duo laptop I use now.

I imagine there is much room for improvement. MySQL (which Trout says that Forumwarz uses) has a rather useful “Memory” table type that can be used for temporary tables that are rapidly written, and could help relieve some of the load, if it’s not already being used here in some way. Apache (especially under Linux) makes administration pretty “blind”, but you can probably find some pretty slick tools to show you where the bottleneck is. And as one user had already mentioned, there are people that can help pick better hardware or make better use of it… I’m all for one-server solutions (they’re far more efficient at processing data), and I imagine one server can continue to do everything, just with a little tweaking. Log in to see images!

OK – you are one huge code dweeb – respect….

SimplyTHEBEST

Avatar: Rocker Chick
17

Level 69 Camwhore

“Venereal Biohazard”

Sadly, I have a degree in this kind of ****.

Srsly: Second server, RAMDisk, prepping for future load-balancing needs.

If FW was closer, I might have been able to donate some hardware to help.

Also, does anybody else wish that Linux provided an alternate netcode system for low-throughput latency-sensitive tasks?

I find it more than a little disheartening that not only does this simple capability not currently exist in software, but worse still that a $130 ‘gimmick’ card like the Killer NIC actually provides noticeably improved performance simply by doing so!

Inertia

Avatar: 60995 Fri Apr 03 12:59:05 -0400 2009
34

[Shii is gay]

Level 35 Troll

also wow i have no male reproductive organ

SimplyTHEBEST Posted:

Out of everything, the only part of forumwarz that actually suffers when lag steps in is pwning threads. bumuming that they’re running a single-server solution, I would suggest sticking the pwnage system on it’s own server and storing all forum data on a RAMDisk.

I know nobody cares about it but… Incit suffers too.

SimplyTHEBEST

Avatar: Rocker Chick
17

Level 69 Camwhore

“Venereal Biohazard”

Inertia Posted:

I know nobody cares about it but… Incit suffers too.

While that may be true, Incit probably suffers mostly because people are pwning threads on the same server. Also, most Incit timers are quite a bit longer than any of the job timers, and you don’t earn vanilla scoops based on how fast you are at Incit.

I did take Incit into account when making my suggestion, and I honestly do think that my suggestion provides the best return on investment.

Evil Trout

MODERATOR
Avatar: 35 2023-04-24 23:24:10 +0000

[Crotch Zombie]

Level 21 Hacker

this site is deader than the toddlers in my basement

Time to get technical!

The Forumwarz battle engine is pretty complex at this point.

As it’s been pointed out, every attack you make is actually an AJAX request to the server. If it wasn’t done this way, it would be way too easy to exploit as all the battle data would be in your browser’s memory.

Generally, making an attack is very quick; Our average invocation time over the last 24 hours is 120ms. It is quick because almost everything is held in memory, in memcached.

Once you enter a battle, the server takes a snapshot of your stats, and creates all the threads you can battle and throws them into the cache.

Every action you can perform in Forumwarz is actually represented by regular ruby code. For example, here is the “Post Bra” attack from the camwhore:

clbum EventHandlers::Abilities::Camwhore::Bra < EventHandlers::ActionBase

  decrease :enemy, :pwnage, :value => 10..15
  decrease :player, :sexiness, :value => 1
  inactivate_action :turns => 1
  minimum :sexiness, :value => 1
    
end

The clbum looks pretty simple, but the first time Ruby parses it, it actually uses meta-programming to flesh out dozens of methods. The most important one is execute, which takes a reference to the battle object we stored in memory and performs all the battle logic against it.

When rails is running in production mode, it caches all the clbumes it uses. So when you say “Post Bra”, it knows exactly what it has to do, and it does it very quickly.

Once it runs the ability code, it gets back a list of what was effected (for the bouncing numbers, or if you died, etc.) and sends that back as javascript to the client.

There are times when an attack has to access the database. Usually they occur on the last thread in the forum when you beat it (to mark the forum as pwned, award scoops, continue missions, etc.) but there are a few exceptions that do very quick database work when an attack occurs.

Okay, so if it’s so fast, why do we experience lag at times?

When battle lags is it almost certainly not the traditional culprit (the database), unless you are on the last thread. It is a sign that the server is overloaded doing something else.

Another request (really, anywhere on the site) might have a bug or an unoptimized use case where it takes a huge amount of memory or CPU. If the server is being sucked dry processing something else, your request has to wait.

Often it’s an issue of concurrency. We can handle about 50 requests per second consistently with our current configuration, but if we spike to 75 or so, requests have to be queued up. If requests are coming in faster than the server can handle them, we’re in trouble.

Basically what I’m getting at is lag can occur for many different reasons. It changes based on the time of day and the current load on the server. Right now we’re profiling every action to the server and optimizing out the slowest ones. It’s an ongoing process.

At some point we might have to move to a multiple server configuration. We’ve been lucky enough so far that we’ve managed to scale without it, because it’s much more expensive than what we’re paying now.

Also, it’s hard to justify getting new hardware when the server is not lagged most of the time. Actually every time I see one of these threads I try entering a battle and always seem to find that things are going really quickly. The battle action is the second most requested

url on our site, with about half a million attacks being done in the last 24 hours, and it averaged 120ms. Of course there could be periods of minutes where it’s horribly lagged and requests don’t respond, but on average it’s very quick.

If you consistently experience lag, please submit a detailed bug report including the following information:

– What web browser are you using

– What time did you most recently experience lag?

– What time of day do you typically play? Is it always the same or does it vary?

– Is it always on the same forum, or different forums?

– Is it the same attack, or different attacks?

Honestly I beg people to submit detailed bug reports because a report that just says “Lag” is completely useless to us. We need lots of information to solve the problem.

SimplyTHEBEST

Avatar: Rocker Chick
17

Level 69 Camwhore

“Venereal Biohazard”

You’re entirely right, ET. Usually there’s very little lag going on, but I’m sure you’ve noticed that usage is quite cyclic; the server is perfectly fine most of the day, then the peak hours start, the server gets overloaded, and the response time rockets from, say, 20msec to several seconds and quite a few drops. Normal high usage points are update times, lunch, and when people get home from school or work.

While I hate to resolve issues by throwing hardware at them, there’s a limit to how much you can do with what you have and FW is growing fairly rapidly.

You’ve already said that you store the battle databases in memory, and that battles aren’t CPU intensive. That fits well with my hypothesis that it’s related to the number of server connections and TCP/IP packet handling.

If you have time, you could try to find or code a new TCP/IP stack designed specifically to sacrifice throughput for number of connections and rapid turnaround time, and attach that to a network interface that’s separate from the other server functions. Since consumer grade TCP/IP handling (Both NICs and stacks, for related reasons) tends to die once you hit around 60 concurrent connections, this might be worth considering.

Internet Delay Chat
Have fun playing!
To chat with other players, you must Join Forumwarz or Log In now!