Shared server - is my forum too big now?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
User avatar
garble
Registered User
Posts: 129
Joined: Sat Dec 04, 2004 9:57 am

Shared server - is my forum too big now?

Post by garble »

I'm getting the mysql max_connections error on a daily basis during busy times. I'm trying to figure out if it's because it's on a shared server and I've outgrown it, or it's a scripting problem because I've done something wrong with a modification, or something else. Any comments would be welcome.

1. Forum is up to 20-40GB bandwidth per month, 10k-20k pageviews per day (over 30k daily this week), or about 500k pageviews per month. Host says they allow 100 connections at any one time for the whole server. The odd thing is I have other php/mysql websites on the same server, I never see the max_connections error on them, and they're still available even when the phpbb forum is not.

Would it make sense that I've just outgrown hosting capacity and should move to a dedicated server? Or is there another option?

2. I've checked all mysql connections, that I've added myself, are closed at the end of the script. And I changed all "pconnects" to "connects". From what I've been reading, that shouldn't matter anyway.

3. Is there a 3rd (or 4th or ...) possibility I haven't thought of that I could check?
Ignore garble :mrgreen:
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Shared server - is my forum too big now?

Post by Lumpy Burgertushie »

I bet you have simply outgrown your shared server.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
ric323
Former Team Member
Posts: 22910
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Shared server - is my forum too big now?

Post by ric323 »

YOu might find some good ideas in this topic: [2.0.x] Tweaks for large forums
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: Shared server - is my forum too big now?

Post by Dog Cow »

One thing you could do would be to create a second MySQL user and add it to your database. Then when you get the error, you can switch users and see what effect that has.

This is cool: it's a change to config.php to rotate MySQL users. What we do here is to assume both have the same privileges to the database, then we can use mt_rand() to determine which one to use for each page load.

Code: Select all

$dbms = 'mysql4';
$dbhost = 'localhost';
$table_prefix = 'phpbb_';
$dbname = 'phpbb2devboard';
if (mt_rand(1,2) == 1)
{
    $dbuser = 'dougk';
    $dbpasswd = 'dougkff7';
}
else
{
    $dbuser = 'dogcow';
    $dbpasswd = 'macos1988';
}

So you'd just fill out those details to match your actual setup, and then try it out.
User avatar
garble
Registered User
Posts: 129
Joined: Sat Dec 04, 2004 9:57 am

Re: Shared server - is my forum too big now?

Post by garble »

Thanks for your replies, appreciate it (and apologies for taking so long to reply myself).

>Dog Cow: That sounds useful, I'll try that. I had already added an if ... else to force several disconnections whenever the limit was reached, but it didn't seem to have the expected effect.

>ric323: Thanks, yes that's a great topic. I didn't think my forum was that big but I might have to revisit that assumption.

>Lumpy Burgertushie: Yes, I was sort of afraid of that, but if that's the case then at least I don't have to keep worrying if I've made an error with one of my hacks.
Ignore garble :mrgreen:
Locked

Return to “2.0.x Support Forum”