Tech Note: Live Comments, 2

Charles Johnsonfollow me on twitter
Science • Sat Nov 29, 2008 at 2:58 pm PST • Views: 149

I had to take down the front page live comment updates for a couple of days to figure out why MySQL was deadlocking. We all know how painful that can be.

Turns out that MyISAM tables suffer from an obscure problem related to concurrent reads and writes, that’s exacerbated when the SELECT query uses a GROUP BY clause. The comments at LGF need to be stored in MyISAM tables in order to allow the use of FULLTEXT indexing, which greatly helps with searching. But the Ajax DB query that periodically checked for new comments in each front page thread was causing that deadlock condition.

The solution was to use a separate table in InnoDB format (which doesn’t have the concurrent deadlocking problem) that is updated every time a comment is posted, with just the info needed to display the live comments on the front page. This ends up being much faster as well, which is a good thing since the code runs in every logged-in browser, every 15 seconds. It’s been running for over an hour with no sign of deadlocking, so I’m prepared to pronounce the bug dead.

If that made no sense to you, worry not. Hey, look! An open thread!

Advertisement

430 comments

^ back to top ^

Name:

Pass:

Register Forgot Your Password? Account Settings Re-send Confirmation (To log in, cookies must be enabled in your browser!)

Turn off ads by subscribing!
For about 33 cents a day, our subscription option turns off all advertisements at LGF!
Read more...


► LGF Headlines

  • Loading...

► Tweeted Articles

  • Loading...

► Tweeted Pages

  • Loading...

► Top 10 Comments

  • Loading...

► Bottom Comments

  • Loading...

► Recent Comments

  • Loading...

► Tools/Info

► LGF Hits

► Resources

► Never Forget

► Statistics

► Tag Cloud

► Contact

You must have Javascript enabled to use the contact form.
Your email:

Subject:

Message:


Messages may be published in our weblog, unless you request otherwise.
Tech Note:
Using the Contact Form

More Partners

Compare Electricity Prices in your area. Texas Electricity is deregulated; you have the right to choose Texas Electric Rates from among many Texas Electric Companies.

Helping moonbats sleep soundly.

TwitterFacebook
LGF Pages
Recent Pages

Ms. MacIceweasel
Half of Conservatives Are Now Against Breast Cancer Screenings
12 minutes ago
Views: 7 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Himalayan Glaciers -- 'No Melt in 10 Years'
19 minutes ago
Views: 28 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Trial opens 2 years after feds break up Christian militia
43 minutes ago
Views: 40 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Obama's budget headed to Congress
58 minutes ago
Views: 52 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Dreyfus and the Birth of Intellectual Protest
3 hours, 47 minutes ago
Views: 55 • Comments: 0
Tweets: 0 • Rating: 1

researchok
The Man Who Wouldn't Die: New York's Most Fantastic Murder
3 hours, 50 minutes ago
Views: 77 • Comments: 0
Tweets: 0 • Rating: 3

researchok
Mitt's Spin
3 hours, 52 minutes ago
Views: 53 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Strategy
3 hours, 52 minutes ago
Views: 46 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Gender Wage Gap Skewed by Survey Flaws - Miller-McCune
3 hours, 53 minutes ago
Views: 56 • Comments: 0
Tweets: 0 • Rating: 1

researchok
Why Obama Would Be Glad if the Culture War Is a Major Election Issue
3 hours, 54 minutes ago
Views: 74 • Comments: 0
Tweets: 0 • Rating: 1

 Frank says:

Great googly-moogly - you're gonna do it too!