Tech Note: MySQL Speed Improvements

Charles Johnsonfollow me on twitter
Sun Mar 30, 2008 at 4:11 pm PDT • Views: 312

After scratching my head, pulling out my hair, consulting the Necronomicon, and Googling like a fiend for terms like “persistent connections” and “query cache bug,” I’ve made some changes to the LGF Blog Engine database layer that seem to have greatly improved performance. I didn’t want to say anything immediately, because the server hears you and then gets rebellious, but after several hours of tweaking and testing it now looks like the speed increase is genuine—and most pages seem to load at least twice as fast, comparing the current speed to the best case speed before the changes.

Technically, it was a matter of:

* setting the MySQL variables ‘interactive_timeout’ and ‘wait_timeout’ to 20 seconds.

* using a “persistent” database connection on the web server, so that connections are shared from a pool of existing connections, and each access doesn’t have to open a new one. The ‘timeout’ variables above set how long those persistent connections are allowed to remain open.

* turning on the MySQL query cache, which I still may turn off again if it exhibits the bug I was Googling for above.

If that’s Martian to you, don’t worry about it, just relax and enjoy the speed improvement…

Advertisement

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

There are mischiefs to be cured.

TwitterFacebook
LGF Pages
Recent Pages

Randall Gross
Mitt Romney: Little to Like: DNC Spoofs Romney Facebook Timeline
58 minutes ago
Views: 40 • Comments: 0
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'
5 hours, 6 minutes ago
Views: 69 • Comments: 0
Tweets: 0 • Rating: 0

Haywood Jabloeme
Closing the Racial and Generational Divides
8 hours, 56 minutes ago
Views: 79 • Comments: 0
Tweets: 0 • Rating: 1

Channeling Confucius
The International Response to Syria After the Houla Massacre
10 hours, 49 minutes ago
Views: 89 • Comments: 0
Tweets: 0 • Rating: 0

Aziz Poonawalla
I Speak for Myself: All-American
12 hours, 52 minutes ago
Views: 123 • Comments: 0
Tweets: 0 • Rating: 5

Aigle
Mainliners Speak Truth to Jewish, Not Arab and Muslim Power
17 hours, 9 minutes ago
Views: 337 • Comments: 10
Tweets: 0 • Rating: -5

Mostly sane, most of the time.
So wake up and notice already
2 days, 8 hours ago
Views: 289 • Comments: 0
Tweets: 2 • Rating: 7

Daniel Ballard
Late Afternoon Light-Kalanchoe
3 days, 12 hours ago
Views: 265 • Comments: 0
Tweets: 0 • Rating: 5

Eclectic Infidel
City College of San Francisco Budget Update
3 days, 13 hours ago
Views: 311 • Comments: 0
Tweets: 0 • Rating: 2

MichaelJ
Apple TV Slated to Debut in December?
4 days, 19 hours ago
Views: 368 • Comments: 0
Tweets: 0 • Rating: 1

 Frank says:

You get nothing with your college degree -- from Roxy & Elsewhere