Tech Note: MySQL Speed Improvements

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

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

We don't feel like satan.

TwitterFacebook
LGF Pages
Recent Pages

Randall Gross
Youth for Western Civilization Takes 'Patriot' Plunge
9 minutes ago
Views: 20 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
'Sovereign Citizen' Sues Government Over Grammar
13 minutes ago
Views: 27 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Apple 'Determined' to Improve Conditions at Plants in China
33 minutes ago
Views: 34 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Something From Nothing - a Conversation W/ Richard Dawkins & Lawrence Krauss
34 minutes ago
Views: 34 • Comments: 0
Tweets: 0 • Rating: 0

researchok
California's Demographic Revolution
3 hours, 59 minutes ago
Views: 75 • Comments: 0
Tweets: 0 • Rating: 2

researchok
The Folly of Internet Freedom: The Mistake of Talking About the Internet as a Human Right
4 hours, 1 minute ago
Views: 57 • Comments: 0
Tweets: 0 • Rating: 2

researchok
Supreme Makeover
4 hours, 4 minutes ago
Views: 54 • Comments: 0
Tweets: 0 • Rating: 0

researchok
A Pattern Emerges
4 hours, 5 minutes ago
Views: 58 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Thai Police Charge 2 Over Bangkok Blasts as Iran Denies Involvement
4 hours, 9 minutes ago
Views: 62 • Comments: 0
Tweets: 0 • Rating: 2

researchok
Putin Won't Go Quietly - if at All
4 hours, 11 minutes ago
Views: 71 • Comments: 0
Tweets: 0 • Rating: 2

 Frank says:

A lot of things wrong with society today are directly attributable to the fact that the people who make the laws are sexually maladjusted. -- from "I Seem To Be a Verb" by R. Buckminster Fuller, 1970.