• 01 Upstart Blogger
  • 02 About
  • 03 Thirty Days
  • 04 Downloads
  • 05 Services
  • 06 Forums


Hosting that doesn’t suck. Use code UPSTARTBLOGGER for 3 free months!
Skip to content
Skip to content
May 11  07

The Pligg Bug That Can Bring Your MySQL Server Down

Robert EllisPligg1 Comment

If you’re still running an older version of Pligg (pre-Beta 9.5) and you get a spike in traffic, it could bring your MySQL server down. The fix is easy. Here’s how.

Note: If you’re running Pligg Beta 9.5 or later, you don’t need to worry about this. I’m writing this up to help you avoid the head scratching I just went through.

A Little Background

After getting a bump in traffic on the Upstart Blogger Grapevine after my post about the Upstart Blogger One Pligg template, I was greeted with this error message when I went to look at my Mint stats:

MySQL Error: User [name] has already more than ‘max_user_connections’ active connections.

Refreshing the page a few minutes later, everything was fine. But since all of my domains run WordPress or Pligg, both of which rely on MySQL, and MySQL had too many connections, there was a good chance you were greeted by a similar error page if you tried to visit one of my sites this morning.

At first I thought it was a problem with my host, AN Hosting. But when I submitted a ticket, I got this message from Dmitry in support:

Dear customer, the problem is your scripts use pconnect() function instead of connect one. Your scripts open connections and don’t close them. That is why there are a lot connections even from scripts that were executed 1 hour ago.

I increased your maximum connections to allow your site working perfectly. Please chek and please use connect() function to avoid such problem in the future.

Great. But how to find the offending script? I searched within all my WordPress files and plugins, then all the files in the latest Pligg version, Beta 9.5. Nothing. I sent Dmitry an email asking for help. He identified the problem in the Upstart Blogger Grapevinedatabase which, I remembered, is running an older version of Pligg. I ran a quick search on all the files and found the culprit in /libs/db.php.

The Fix

The fix is simple. Open /libs/db.php in your Pligg installation (remember, if you’re running Pligg Beta 9.5 or later, you don’t need to worry about this), and find the offending line near the top of the file:

$globals['mysql_persistent'] = true;

Then, set persistent=false.

You’ll find more about this in the Pligg forums in Overload request of mysql? and in Should one use true or false for mysql_persistent? (There’s nothing if you do a search for pconnect).

For more about pconnect and connect, see PHPFAQ.

 Stumble it!
Browse Timeline
  • < Pligg Template: Upstart Blogger One
  • > WordPress Theme: Upstart Blogger Modio
  • Browse Pligg
  • < Pligg Template: Upstart Blogger One
  • > Pligg Template: Upstart Blogger Future First
Related
  • UpstartAqueous Pligg Template Updated to 0.3
  • UpstartAqueous Pligg Template Updated to 0.2
  • FuturePligg Solemnity Pligg Template Updated to 0.4
  • Pligg Templates Update Status
  • UpstartAqueous Pligg Template Updated to 0.4
Comments
  1. indya added these pithy words on 29 May 07

    Post your articles on http://www.bestofindya.com

Comments are moderated. It may take some time before your comment appears. Please be patient. Comments become the property of Upstart Blogger.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Note: Please post support questions in the Forums. Be sure to read the Upstart Blogger WordPress Themes FAQ before posting. Thanks!

Your email is never published nor shared. Required fields are marked *

*
*

Hosting that doesn’t suck. Use code UPSTARTBLOGGER for 3 free months.

Return to Top
    Entry Meta
    Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.
    Free Thirty Day Blogging Course

    Make money online with the free Upstart Blogger thirty day blogging course. Get the details!

    Search
  • Subscribe

    Don’t miss a tip, trick, or theme. Subscribe to Upstart Blogger via email. Or grab the posts feed or comments feed.

    Hosting

    Looking for a host that doesn’t suck? AN Hosting offers 500 GB disk space, 5 TB transfer, and a free domain for life, all for only $6.95 a month! Use code UPSTARTBLOGGER for 3 free months!

    Web Hosting by AN Hosting Web Hosting by AN Hosting

    Recent Comments
    • Kathy on When the money keeps rolling in
    • Steffan Williams on When the money keeps rolling in
    • Jake Styles on Should I release this Wordpress theme?
    Donate

    My themes are free, but if you find them useful you can donate to my rainy day fund.

    Quickstart

    New to blogging? Start here: 25 Steps to Launching Your Blog and Making $100+ A Month in 30 Days.

    Most web hosts suck. What can you do? Forget DreamHost. Read How to Find a Web Host That Doesn’t Suck. Or, just go right to the best host. Use code UPSTARTBLOGGER for 3 free months!

    New to WordPress? No sweat. Check these: Getting Started With WordPress: Administration Quick Tour and Getting Started With WordPress: Basic Settings.

    This post could save your life: 8 MySQL Backup Strategies for WordPress Bloggers (And Others).

    How important is design? Your blog doesn’t have to look like all the others. Check out the Upstart Blogger WordPress themes.

    Upstart Blogger Futurosity Magazine WordPress ThemeUpstart Blogger Takimata WordPress ThemeUpstart Blogger ModicusModioMinim

    Dip into design by reading these posts: Tools for Capturing Design Inspiration and Quick Web Design Mockups Using iWeb.

  • Archives
  • October 2008 (3)
  • September 2008 (20)
  • August 2008 (20)
  • July 2008 (20)
  • June 2008 (20)
  • May 2008 (21)
  • April 2008 (22)
  • March 2008 (27)
  • February 2008 (28)
  • January 2008 (32)
  • December 2007 (6)
  • November 2007 (5)
  • October 2007 (9)
  • September 2007 (2)
  • August 2007 (6)
  • July 2007 (4)
  • June 2007 (8)
  • May 2007 (17)
  • April 2007 (8)
  • March 2007 (6)
  • February 2007 (1)
  • January 2007 (6)
  • December 2006 (3)
  • November 2006 (13)
  • October 2006 (4)
  • February 2006 (2)
  • January 2006 (9)
  • December 2005 (1)
  • October 2005 (3)
  • September 2005 (13)
  • August 2005 (5)
  • July 2005 (8)
  • June 2005 (4)
  • May 2005 (1)
  • February 2005 (3)
  • July 2004 (1)
  • Categories
  • Blog Network (1)
  • Blogging (104)
  • Books (3)
  • Design (54)
  • Etc. (10)
  • Giveaways (22)
  • GTD (3)
  • Hosting (12)
  • Money (43)
  • News (5)
  • Personal (12)
  • Pligg (16)
  • Podcasting (2)
  • Publishing (1)
  • Social Networking (4)
  • Software (23)
  • Textpattern (3)
  • The Pitch (1)
  • Tips (14)
  • Traffic (7)
  • Webjockey (12)
  • WordPress (48)
  • Wordpress Theme (4)
  • Translate

    Login
    • Login
Readers

Join / View

Footsie

Copyright © 2008 by Upstart Blogger, unless otherwise noted. All rights reserved. Design by Upstart Blogger. Built on Sandbox. Powered by WordPress. Hosting by AN Hosting. AN Hosting offers 500 GB disk space, 5 TB transfer, and a free domain for life, all for only $6.95 a month! Use code UPSTARTBLOGGER for 3 free months! Read the privacy policy.