Tech Note: MySQL Speed Improvements

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

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.

The terrible infant speaks.

TwitterFacebook
LGF Pages
Recent Pages

researchok
'I Was Looking Forward to a Quiet Old Age': Instead, Etta Shiber, Helped Smuggle Stranded Allied Soldiers To Freedom
4 hours, 21 minutes ago
Views: 56 • Comments: 0
Tweets: 1 • Rating: 0

Daniel Ballard
Late Afternoon Light-Kalanchoe
12 hours, 2 minutes ago
Views: 99 • Comments: 0
Tweets: 0 • Rating: 4

MikeySDCA
Colin Powell Endorsed Same-Sex Marriage Once It Was Safe, More Evidence He's Hardly a Great Leader.
12 hours, 6 minutes ago
Views: 129 • Comments: 1
Tweets: 0 • Rating: 1

Eclectic Infidel
City College of San Francisco Budget Update
12 hours, 55 minutes ago
Views: 117 • Comments: 0
Tweets: 0 • Rating: 0

Michael McBacon
Kansas governor signs 'Shariah bill' to ban Islamic law
17 hours, 25 minutes ago
Views: 228 • Comments: 6
Tweets: 0 • Rating: 5

Aigle
National Geographic Traveler Veers Off Track
1 day, 17 hours ago
Views: 450 • Comments: 7
Tweets: 0 • Rating: -5

MichaelJ
Apple TV Slated to Debut in December?
1 day, 18 hours ago
Views: 226 • Comments: 0
Tweets: 0 • Rating: 1

Ascher
Israeli Who Saved Turk on Everest: You Never Abandon a Friend - Israel News, Ynetnews
1 day, 19 hours ago
Views: 297 • Comments: 1
Tweets: 0 • Rating: 3

Haywood Jabloeme
The Harrassment of Patterico & Its Roots in Left-Wing Activism
1 day, 20 hours ago
Views: 519 • Comments: 2
Tweets: 0 • Rating: 4

Curt
Brian Banks: (Video) Falsely accused of rape speaks out
1 day, 22 hours ago
Views: 272 • Comments: 2
Tweets: 0 • Rating: 5

 Frank says:

Gee, it's so hard to find a place to park around here.