Tech Note: Live Comments, 2

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

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? 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

► 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.

Nobody's human.

TwitterFacebook
LGF Pages
Recent Pages

Shiplord Kirel
'A Dragon Approaches' (fantastically evocative pic from ISS mission)
24 minutes ago
Views: 21 • Comments: 0
Tweets: 0 • Rating: 2

Kragar
Curt Schilling blames Rhode Island for his business going under
28 minutes ago
Views: 39 • Comments: 0
Tweets: 0 • Rating: 1

Randall Gross
CITADEL MALWARE DELIVERS REVETON RANSOMWARE IN ATTEMPTS TO EXTORT MONEY
1 hour, 21 minutes ago
Views: 63 • Comments: 0
Tweets: 0 • Rating: 1

Channeling Confucius
From the previous Diamond Jubilee: Kipling's 'Recessional'
1 hour, 52 minutes ago
Views: 39 • Comments: 0
Tweets: 0 • Rating: 0

Daniel Ballard
Egyptian Student Invents New Propulsion Method - Science - Health & Science - OnIslam.net
2 hours, 44 minutes ago
Views: 85 • Comments: 0
Tweets: 0 • Rating: 2

Bob Dillon
REVEALED: Hundreds of Words to Avoid Using Online if You Don't Want the Government Spying on You
2 hours, 56 minutes ago
Views: 77 • Comments: 0
Tweets: 0 • Rating: 1

Learned Mother of Zion
Native Americans Have Jewish DNA!
3 hours, 16 minutes ago
Views: 173 • Comments: 2
Tweets: 1 • Rating: 3

Eclectic Infidel
Mitt Romney for a better Amercia!
3 hours, 21 minutes ago
Views: 101 • Comments: 1
Tweets: 0 • Rating: 0

Aigle
Ha'aretz, Lost in Translation
6 hours, 35 minutes ago
Views: 149 • Comments: 3
Tweets: 0 • Rating: 0

researchok
French Philosopher Alain Badiou on the Real Expression of Love: 'If You Limit Yourself to Sexual Pleasure It's Narcissistic'
12 hours, 30 minutes ago
Views: 117 • Comments: 0
Tweets: 0 • Rating: 1

 Frank says:

If your children ever find out how lame you really are, they're gonna murder you in your sleep...