MyBB Community Forums

Full Version: Bulletin board wont load with 200+ users online
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Tonight when I tried to go to my board, the index.html (intro page) loaded perfectly. However when I click the link to head to the bb (index.php) it just loads for about 5 minutes then I get an error saying

"500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed."

However I'm following my hit counter and the hits keep going up at about 2 per minute, however on three computers (and a mobile) that I have tried to open it on, it simply wont load.

Also. I can access other parts of the site, just non of the mybb parts. Do you think there is a chance there there are too many people online at once?

Any idea how to fix this?

Cheers
EDIT: After a bit more research i've realised that it's only php pages the wont load...
Hello,
It's very possible it's too many people hitting the site at the exact same time. Which hosting service are you using?

Commonly, shared hosting allows 30 concurrent connections at once.
This means only 30 users can attempting to load your site at once.

So that's why only PHP files would be affected, as they're generally the ones summoning information from the database.

Cheaper posts may provide an even lower limit to 30, 10 to 20.

Here is a workaround code for your config file:

$dbusers = array(
array('user' => 'site_connect1', 'password' => 'DBPassword')
, array('user' => 'site_connect2', 'password' => 'DBPassword')
, array('user' => 'site_connect3', 'password' => 'DBPassword')
, array('user' => 'site_connect4', 'password' => 'DBPassword')
, array('user' => 'site_connect5', 'password' => 'DBPassword')
);
$mysql_user = $dbusers[rand(0, count($dbusers) - 1)];

$config['database']['type'] = 'mysql';
$config['database']['hostname'] = 'localhost';
$config['database']['username'] = $mysql_user['user'];
$config['database']['password'] = $mysql_user['password'];
$config['database']['database'] = 'site_database';
$config['database']['table_prefix'] = 'mybb_';

Replace it with your database information. This code sends the connected user to a random connection. This will require creating multiple user accounts for your database, and granting them full access to the 1 database.

The 15 - 30 concurrent connection limit goes by each account, so the more accounts you have, the less problems there would be.

Be warned though, this may violate policies with your host. Not every host will be okay with this.
hi that means i put these in config file it would be fine
Yes, but you do it at your own risk of getting in trouble with your host.
And you can add as many more connections as you like.
I only listed 5 there as samples.
need some more clarification on these codes these code put as it is or need to change something in these code

i have unlimited mysql database plan with me
i just asked my host about connections and they replied me as follows

Dear Sir/Madam

Sir there is no limit in connections

Thanks & Regards
Technical Support
My guess is a bad htaccess. What's the url?
http://www.disqusin.con

hi labrocca
sorry but unable to under stand your question
(2010-07-29, 04:07 PM)lan7 Wrote: [ -> ]Here is a workaround code for your config file:

$dbusers = array(
array('user' => 'site_connect1', 'password' => 'DBPassword')
, array('user' => 'site_connect2', 'password' => 'DBPassword')
, array('user' => 'site_connect3', 'password' => 'DBPassword')
, array('user' => 'site_connect4', 'password' => 'DBPassword')
, array('user' => 'site_connect5', 'password' => 'DBPassword')
);
$mysql_user = $dbusers[rand(0, count($dbusers) - 1)];

$config['database']['type'] = 'mysql';
$config['database']['hostname'] = 'localhost';
$config['database']['username'] = $mysql_user['user'];
$config['database']['password'] = $mysql_user['password'];
$config['database']['database'] = 'site_database';
$config['database']['table_prefix'] = 'mybb_';

Wink
nice trick. Is itreally work?
(2010-07-30, 02:13 PM)AKT Wrote: [ -> ]need some more clarification on these codes these code put as it is or need to change something in these code

i have unlimited mysql database plan with me
i just asked my host about connections and they replied me as follows

Dear Sir/Madam

Sir there is no limit in connections

Thanks & Regards
Technical Support


hi i just looking the answer of this queston
(2010-07-30, 02:59 PM)FBI Wrote: [ -> ]Wink
nice trick. Is itreally work?

Yes, it does work Wink

I was on a host that only gave 30 connections per user connection on the database. After I did the trick with at least 5 user connections, the problem went away. I then increased it to 10.

It's probably not necessary anymore since I'm using a VPS now. But it's all set up that way and I don't intend on un-doing it.
Pages: 1 2 3