Welcome, Guest. Please login or register.

Author Topic: Recent site performance issues  (Read 6849 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Recent site performance issues
« on: July 10, 2011, 07:54:50 PM »
As most of you will know (if not, see here: http://www.amiga.org/forums/showthread.php?t=54618), the site has been sluggish of late and with intermittent errors popping up.

We've been monitoring the situation for a while and we've ascertained that the site is occasionally tip toeing over the maximum allowed concurrent connections to the database at peak times.

Until a more permanent solution can be found (read a beefier server/hosting package), I've been given the go-ahead on an evil plan I hatched to try and mitigate the issue to some extent. This plan is to basically cache content (for a short time) that is served to all those visitors that aren't logged in.

Allow me to expand on that:

On any normal day, logged-in users are typically outnumbered by anonymous visitors by anything up to a factor of 10 or more. By caching the generated content of several key pages for a few short minutes, the total number of database queries per second can be dramatically reduced and with it, the danger that the server will go over the limit.

On the downside, if you are a regular lurker, you won't necessarily see the most up-to-the-minute view of the page, so perhaps it's time to log in at long last :)

Also on the downside, the thread view statistics will be skewed, since for every cached serving, no counters will be updated. Still, better than not being able to see the site at all, right?

When I upload the patch, there could be some momentary shenanigans. Please stand by...
« Last Edit: July 10, 2011, 08:24:27 PM by Karlos »
int p; // A
 

Offline nicholas

Re: Recent site performance issues
« Reply #1 on: July 10, 2011, 08:10:46 PM »
Sneaky kludges ftw! :)
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Recent site performance issues
« Reply #2 on: July 10, 2011, 08:11:42 PM »
Quote from: nicholas;648955
Sneaky kludges ftw! :)

Think of it as enforcing the Royston Vasey policy :lol:

vBulletin is a beast when it comes to resource utilisation. What I've done is to rename several key php files and add subsitutes for them that add the caching aspect. It's managed in a way that requires no database queries at all when you hit the cache. However, you do hit the disk, so it isn't for free, either.
« Last Edit: July 10, 2011, 08:27:32 PM by Karlos »
int p; // A
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Recent site performance issues
« Reply #3 on: July 10, 2011, 09:03:15 PM »
One other caveat to note is that if you aren't logged in, the indication as to which threads have been read or not will also not be accurate since you will likely be viewing a cached version of the content that someone else was responsible for generating.
int p; // A
 

Offline nicholas

Re: Recent site performance issues
« Reply #4 on: July 10, 2011, 09:08:34 PM »
Quote from: Karlos;648956
Think of it as enforcing the Royston Vasey policy :lol:

vBulletin is a beast when it comes to resource utilisation. What I've done is to rename several key php files and add subsitutes for them that add the caching aspect. It's managed in a way that requires no database queries at all when you hit the cache. However, you do hit the disk, so it isn't for free, either.


Memcached not any help?
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Recent site performance issues
« Reply #5 on: July 10, 2011, 09:13:56 PM »
Quote from: nicholas;648960
Memcached not any help?


Sure, but you need to be running it and that usually means you have your own dedicated server.
int p; // A
 

Offline nicholas

Re: Recent site performance issues
« Reply #6 on: July 10, 2011, 09:16:42 PM »
Quote from: Karlos;648962
Sure, but you need to be running it and that usually means you have your own dedicated server.


Oh I see. Time perhaps for the owners to put the subscription fees and ad revenue towards a server then?
« Last Edit: July 10, 2011, 09:19:53 PM by nicholas »
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Recent site performance issues
« Reply #7 on: July 10, 2011, 09:20:34 PM »
Quote from: nicholas;648965
Oh I see. Time for the owners to put the subscription fees and ad revenue towards a server then.

Whatever they do longer term, we need to at least mitigate the recent problems. Taking the strain off the database will hopefully accomplish that. Every time you read a page in a thread there are several database queries and typically more writes than there are than reads. For a "cached" page, you are getting several filesystem reads: one to check the file exists and another  to check it's changed time and finally retrieving it's contents. The first two reads actually are only one since checking for the file existing causes an fstat() call and php caches the results of those over the lifetime of a script.
« Last Edit: July 10, 2011, 09:23:48 PM by Karlos »
int p; // A
 

Offline Lando

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 1390
    • Show only replies by Lando
    • https://bartechtv.com
Re: Recent site performance issues
« Reply #8 on: July 10, 2011, 09:25:26 PM »
There are some other weird things happening with the site.  When I was reading this thread, I happened to look up at the top of the page and it said "Welcome, Transition, you last logged in today at 5:16 AM".

I am not Transition, I am Lando.  I logged out and logged back in as me, how did I ever get logged in as Transition?
 

Offline TheGoose

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1458
  • Country: us
  • Gender: Male
    • Show only replies by TheGoose
    • http://www.amiga.org/forums/blog.php?u=827
Re: Recent site performance issues
« Reply #9 on: July 10, 2011, 09:35:04 PM »
Good job Karlos, all those explanations and solutions are right-on in my mind.
Amiga.org is umm, too health of a community at times. A good problem to have my boss would say.
G1200, A3000D, A1200 PPC AOS4.0C

I\'m on Google +
 

Offline Pyromania

  • Sent from my Quantum Computer
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 1820
  • Country: 00
  • Thanked: 6 times
    • Show only replies by Pyromania
    • http://www.discreetfx.com
Re: Recent site performance issues
« Reply #10 on: July 10, 2011, 09:36:05 PM »
Quote from: Lando;648971
There are some other weird things happening with the site.  When I was reading this thread, I happened to look up at the top of the page and it said "Welcome, Transition, you last logged in today at 5:16 AM".

I am not Transition, I am Lando.  I logged out and logged back in as me, how did I ever get logged in as Transition?


It was a momentary flux in the Matrix.

:)
 

Offline AmigaHeretic

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 821
    • Show only replies by AmigaHeretic
Re: Recent site performance issues
« Reply #11 on: July 10, 2011, 09:40:01 PM »
Quote from: Lando;648971
There are some other weird things happening with the site.  When I was reading this thread, I happened to look up at the top of the page and it said "Welcome, Transition, you last logged in today at 5:16 AM".

I am not Transition, I am Lando.  I logged out and logged back in as me, how did I ever get logged in as Transition?


Yeah, I'm logged in.  On the front page for this thread is says " Pyromania" is the last person to comment in this thread.  I've checked it a few times before posting this and Lando is the last person to post in the thread.

So did "Pyromania" actually post in the thread and I can't see it even though I am logged in (for a while and several refreshes) or does the system think Lando was Pyromania?

EDIT:  

Ok, now after submitting my post I see the Goose and  Pyromania had both posted.  I couldn't see either post even after opening up another refreshing a couple times to see if it was an error and then trying another browser window and refreshing.  Weird.
« Last Edit: July 10, 2011, 09:43:18 PM by AmigaHeretic »
A3000D (16mhz, 2MB Chip, 4MB Fast, SCSI (300+MB), SuperGen Genlock, Kick 3.1)
Back in my day, we didn\'t have water. We only had Oxygen and Hydrogen, and we\'d just have to shove them together.
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Recent site performance issues
« Reply #12 on: July 10, 2011, 09:47:28 PM »
Ok, it looks like this plan requires more work - it seems likely that at the moment you log in, that first page gets cached.

I will revert the changes. Luckily, that's not difficult.

-edit-

*done*
« Last Edit: July 10, 2011, 09:53:11 PM by Karlos »
int p; // A
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Recent site performance issues
« Reply #13 on: July 10, 2011, 09:51:32 PM »
Quote from: Lando;648971
There are some other weird things happening with the site.  When I was reading this thread, I happened to look up at the top of the page and it said "Welcome, Transition, you last logged in today at 5:16 AM".

I am not Transition, I am Lando.  I logged out and logged back in as me, how did I ever get logged in as Transition?

You didn't. You were served a page that Pyromania managed to get cached after logging in. If you had gone anywhere, you'd not have had access to any of his account.
int p; // A
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Recent site performance issues
« Reply #14 on: July 10, 2011, 09:56:57 PM »
Anyway, theory is good, implementation needs more work :lol:
int p; // A