Approve the Cookies
This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies and our Privacy Policy.
OK
Forums  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear
Guest
Forums  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear
Register to forums    Log in

 
FORUMS Forum FAQ and Information Forum Talk 
Thread started 06 Jul 2007 (Friday) 23:21
Search threadPrev/next
sponsored links (only for non-logged)

Forum "hiccups"? (technical)

 
kcbrown
Cream of the Crop
Avatar
5,384 posts
Likes: 2
Joined Mar 2007
Location: Silicon Valley
     
Jul 06, 2007 23:21 |  #1

Every once in a while (a few times a day), the forums will appear to "hang" for 30 seconds or so. Sometimes, after it does so, it'll come back with a message saying the server is too busy. The responsiveness of the forums is usually excellent right before that happens, and a minute or so later it will appear to have recovered fully.

Here's where it gets technical and speculative.

The forum software is vBulletin. It uses MySQL as a backend.

MySQL has a number of table types it can use, the most prominent being MyISAM and InnoDB.

MyISAM is the default table type. It's also the one that's been around the longest. But most importantly, from a database perspective, it's also the one that has the most limitations.

MyISAM isn't very friendly in an environment involving a lot of concurrent reads and writes. It's friendly enough when all that's happening are reads with an occasional write thrown into the mix. But it tends to fall over when writes are thrown in. And it has no clue about transactions (which means that if an error occurs when writing to one of the tables, the client software, vBulletin in this case, has to go back to the tables it has already written to and undo whatever it did).

When a write occurs on a MyISAM table (say, for instance, when you post a message), MySQL will acquire a "full table lock" on the table it's currently writing to. The reason it does so is to prevent other readers and writers from reading inconsistent data from the table or, worse, writing conflicting data into the table such that the table would get corrupt. The lock prevents that kind of corruption. But it exacts a very heavy price on performance.

The lock is held for the duration of the write. If there's a lot of data to write to the table, the table will be inaccessible to everyone who is trying to read from it or write to it until the lock is released.

When the forum "locks up" this way and eventually comes back saying the server is "too busy", I believe it's because of the one or more full table locks that have been taken by the database.


InnoDB doesn't have any of these limitations. When a write occurs, the change is recorded in a transaction log and a new version of each of the rows involved is created. Old versions are eventually scrubbed, but won't be as long as there's a running transaction that the database knows has seen them. The end result is that when a write occurs, readers aren't blocked, only other writers, and then only for the rows that they are updating, not the entire table.


And so, after all this, the question of the day is: is the InnoDB table type being used for this forum? If it's not, can it be (it may require migration)? MySQL-based sites such as slashdot.org are using it to very good effect. I would be willing to donate some of my time towards a migration effort if it's desired.


"There are some things that money can't buy, but they aren't Ls and aren't worth having" -- Shooter-boy
Canon: 2 x 7D, Sigma 17-50 f/2.8 OS, 55-250 IS, Sigma 8-16, 24-105L, Sigma 50/1.4, other assorted primes, and a 430EX.
Nikon: D750, D600, 24-85 VR, 50 f/1.8G, 85 f/1.8G, Tamron 24-70 VC, Tamron 70-300 VC.

  
  LOG IN TO REPLY
kcbrown
THREAD ­ STARTER
Cream of the Crop
Avatar
5,384 posts
Likes: 2
Joined Mar 2007
Location: Silicon Valley
     
Jul 06, 2007 23:25 |  #2

Oh, one more thing: InnoDB makes taking a consistent online backup of the data in the tables possible without affecting the users, because it's transactional and readers don't block writers. So the backup procedure could start a serializable transaction and then grab all the data from all the tables, all without having an effect on anyone else. To do so with MyISAM would require locking all the tables at the same time, thus preventing writes to all tables while the data is copied.


"There are some things that money can't buy, but they aren't Ls and aren't worth having" -- Shooter-boy
Canon: 2 x 7D, Sigma 17-50 f/2.8 OS, 55-250 IS, Sigma 8-16, 24-105L, Sigma 50/1.4, other assorted primes, and a 430EX.
Nikon: D750, D600, 24-85 VR, 50 f/1.8G, 85 f/1.8G, Tamron 24-70 VC, Tamron 70-300 VC.

  
  LOG IN TO REPLY
Belmondo
Cream of the Crop
Avatar
42,735 posts
Likes: 15
Joined Jul 2003
Location: 92210
     
Jul 07, 2007 01:27 as a reply to  @ kcbrown's post |  #3

KC:
You lost me about 5 words into your explanation. Your offer of help is very generous. I'll make sure Pekka sees this.


I'm not short. I'm concentrated awesome!

  
  LOG IN TO REPLY
kcbrown
THREAD ­ STARTER
Cream of the Crop
Avatar
5,384 posts
Likes: 2
Joined Mar 2007
Location: Silicon Valley
     
Jul 07, 2007 03:14 |  #4

belmondo wrote in post #3501142 (external link)
KC:
You lost me about 5 words into your explanation. Your offer of help is very generous. I'll make sure Pekka sees this.

That's why I asked whether or not this forum would be an appropriate place for this kind of question. :D

Thanks for forwarding it to Pekka. And my apologies for losing you in my explanation.


"There are some things that money can't buy, but they aren't Ls and aren't worth having" -- Shooter-boy
Canon: 2 x 7D, Sigma 17-50 f/2.8 OS, 55-250 IS, Sigma 8-16, 24-105L, Sigma 50/1.4, other assorted primes, and a 430EX.
Nikon: D750, D600, 24-85 VR, 50 f/1.8G, 85 f/1.8G, Tamron 24-70 VC, Tamron 70-300 VC.

  
  LOG IN TO REPLY
Pekka
El General Moderator
Avatar
18,384 posts
Gallery: 36 photos
Best ofs: 7
Likes: 2448
Joined Mar 2001
Location: Hellsinki, Finland
     
Jul 07, 2007 06:47 |  #5

Thanks kcbrown, I appreciate you time and effort.

I am fully aware of differences between innodb and myisam, and converting tables to innodb is not something I would do now. There are reasons like this:

(Kier, vBulletin Lead Developer): vBulletin is optimized for use with the MyISAM table type. InnoDB has some advantages, but it also has some serious issues when used with vBulletin, such as the small limit on the size of data columns, which badly breaks the language table.

and

- FULLTEXT indexes do not work with innodb (might install Sphinx so that might not be an issue then)
- innodb is much slower with SELECTs, and the forum is 90% about reading rows. When MySQL remedies the innodb speed penalty, I'll reconsider.

This server is now running in "memory save mode" (small buffers for db) to be able to accommodate 3000 users online. That means slightly slower speed and sometimes short hiccups. Most of the hiccups are caused by Apache which does not release connections as it should.

The basic problem is search and Apache, and it goes like this: apache prefork httpd process runs php which in turn opens mysql connection for search. Apache won't release the client connection until php gets result back from mysql or something times out. When search takes 20 seconds it means one of the e.g. 250 possible httpd connections are just hanging there without doing anything. On a busy server this accumulates fast when multiple seaches and slow actions are done and sometimes httpd goes into queue mode. The queue timeout is quite short so when you hit that you get "server is too busy".

I've been fighting with Apache for years now, and the only solution is to get rid of it.

I am now preparing a new server which does not have Apache (bought Litespeed Enterprise Server 3 which is amazing), has 4 physical CPU's, 8GB RAM and SAS-SCSI for MySQL and is with much better server provider. The move will happen in very near future.


The Forum Boss, El General Moderator
AMASS 2.5 Changelog (installed here now)

  
  LOG IN TO REPLY
::John::
Cream of the Crop
8,642 posts
Gallery: 54 photos
Likes: 361
Joined Dec 2005
Location: Canberra, Australia
     
Jul 07, 2007 07:25 |  #6

Pekka wrote in post #3501747 (external link)
I am now preparing a new server which does not have Apache (bought Litespeed Enterprise Server 3 which is amazing), has 4 physical CPU's, 8GB RAM and SAS-SCSI for MySQL and is with much better server provider. The move will happen in very near future.

Brilliant! I don't envy you the move - I recently migrated a relatively large Discus board to vBulletin and that was 'interesting'. Moving this beast will be an effort, I suspect. I like the initial specs of your new server - should make a huge difference.


I am the proud owner of the Peleng 8mm Fisheye lens

  
  LOG IN TO REPLY
Pekka
El General Moderator
Avatar
18,384 posts
Gallery: 36 photos
Best ofs: 7
Likes: 2448
Joined Mar 2001
Location: Hellsinki, Finland
     
Jul 07, 2007 07:31 |  #7

::John:: wrote in post #3501848 (external link)
Brilliant! I don't envy you the move - I recently migrated a relatively large Discus board to vBulletin and that was 'interesting'. Moving this beast will be an effort, I suspect. I like the initial specs of your new server - should make a huge difference.

I'm actually pretty sure the page response speed (compared to this server when things work and load is normal) is almost equal, but the new server can handle tons of more people without getting slower.


The Forum Boss, El General Moderator
AMASS 2.5 Changelog (installed here now)

  
  LOG IN TO REPLY
Ronald ­ S. ­ Jr.
Prodigal "Brick" Layer
Avatar
16,481 posts
Gallery: 12 photos
Likes: 71
Joined Aug 2005
Location: Sayre, Pennsylvania
     
Jul 07, 2007 18:30 |  #8

Pekka wrote in post #3501747 (external link)
I am fully aware of differences between innodb and myisam,

I'm glad someone does. :lol:


Mac users swear by their computers. PC users swear at theirs.

  
  LOG IN TO REPLY
kcbrown
THREAD ­ STARTER
Cream of the Crop
Avatar
5,384 posts
Likes: 2
Joined Mar 2007
Location: Silicon Valley
     
Jul 08, 2007 19:29 |  #9

Pekka wrote in post #3501747 (external link)
Thanks kcbrown, I appreciate you time and effort.

I am fully aware of differences between innodb and myisam, and converting tables to innodb is not something I would do now. There are reasons like this:

(Kier, vBulletin Lead Developer): vBulletin is optimized for use with the MyISAM table type. InnoDB has some advantages, but it also has some serious issues when used with vBulletin, such as the small limit on the size of data columns, which badly breaks the language table.

Oh, dear. That would be tough to work around.

- innodb is much slower with SELECTs, and the forum is 90% about reading rows. When MySQL remedies the innodb speed penalty, I'll reconsider.

Is this still the case? I haven't played with that aspect of it much. Most of my recent experience is with PostgreSQL. I've got a decent amount of experience with MyISAM, though, and that experience is what steered me towards PostgreSQL. :D

This server is now running in "memory save mode" (small buffers for db) to be able to accommodate 3000 users online. That means slightly slower speed and sometimes short hiccups. Most of the hiccups are caused by Apache which does not release connections as it should.

The basic problem is search and Apache, and it goes like this: apache prefork httpd process runs php which in turn opens mysql connection for search. Apache won't release the client connection until php gets result back from mysql or something times out. When search takes 20 seconds it means one of the e.g. 250 possible httpd connections are just hanging there without doing anything. On a busy server this accumulates fast when multiple seaches and slow actions are done and sometimes httpd goes into queue mode. The queue timeout is quite short so when you hit that you get "server is too busy".

I've been fighting with Apache for years now, and the only solution is to get rid of it.

Ahhh....okay, this makes sense now. I erroneously thought the "server too busy" message was being issued by vBulletin itself based on how the message looked.

I am now preparing a new server which does not have Apache (bought Litespeed Enterprise Server 3 which is amazing), has 4 physical CPU's, 8GB RAM and SAS-SCSI for MySQL and is with much better server provider. The move will happen in very near future.

I'm certainly looking forward to that, though I will say that for the most part the forums are very speedy. It'll be nice to finally dispense with the hiccups, though.


Thanks for taking the time to reply to me, Pekka. The forums are invaluable.


"There are some things that money can't buy, but they aren't Ls and aren't worth having" -- Shooter-boy
Canon: 2 x 7D, Sigma 17-50 f/2.8 OS, 55-250 IS, Sigma 8-16, 24-105L, Sigma 50/1.4, other assorted primes, and a 430EX.
Nikon: D750, D600, 24-85 VR, 50 f/1.8G, 85 f/1.8G, Tamron 24-70 VC, Tamron 70-300 VC.

  
  LOG IN TO REPLY
sponsored links (only for non-logged)

1,715 views & 0 likes for this thread, 5 members have posted to it.
Forum "hiccups"? (technical)
FORUMS Forum FAQ and Information Forum Talk 
AAA
x 1600
y 1600

Jump to forum...   •  Rules   •  Forums   •  New posts   •  RTAT   •  'Best of'   •  Gallery   •  Gear   •  Reviews   •  Member list   •  Polls   •  Image rules   •  Search   •  Password reset   •  Home

Not a member yet?
Register to forums
Registered members may log in to forums and access all the features: full search, image upload, follow forums, own gear list and ratings, likes, more forums, private messaging, thread follow, notifications, own gallery, all settings, view hosted photos, own reviews, see more and do more... and all is free. Don't be a stranger - register now and start posting!


COOKIES DISCLAIMER: This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies and to our privacy policy.
Privacy policy and cookie usage info.


POWERED BY AMASS forum software 2.58forum software
version 2.58 /
code and design
by Pekka Saarinen ©
for photography-on-the.net

Latest registered member is zachary24
1432 guests, 109 members online
Simultaneous users record so far is 15,144, that happened on Nov 22, 2018

Photography-on-the.net Digital Photography Forums is the website for photographers and all who love great photos, camera and post processing techniques, gear talk, discussion and sharing. Professionals, hobbyists, newbies and those who don't even own a camera -- all are welcome regardless of skill, favourite brand, gear, gender or age. Registering and usage is free.