1

Topic: How many mysql connections are normal for a standard forum?

generally I have about 60 people connected at a time on a given weekday. Sometimes as much as 75. I once had 104 before the board crashed "unable to connect too many mysql connections" it slows noticeably at 70 people. Is this standard. I would like to have more posters but I dont search for them because it seems we are near capacity now. What are the mysql database limits? anyone have more people connected and posting than that? Is it my host? Seems bandwidth may become an issue and my current storage limit isnt enough.


Thanks for any input you guys can give me!

Re: How many mysql connections are normal for a standard forum?

that depends on where your site is hosted

Re: How many mysql connections are normal for a standard forum?

That's a host specific setting, as pedrotuga said.
As for how many, it's 1 per pageview.

Re: How many mysql connections are normal for a standard forum?

Connection limits to MySQL are under the hosts control. Unless you have access your self to editing MySQL's configuration, specifically the entry below:

# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=255

HOWEVER it may not be all up to your host smile

You may be able to cut down on the number of connections your board generates by looking at the plugins you have loaded and also the options you have turned on on your forum.

I'd start by turning on via the setting in /include/common.php

// Enable DEBUG mode by removing // from the following line
define('PUN_DEBUG', 1);

to see how many queries each of your page views is generating.

Without registering to see your forums, it is possible that you may have installed plugins that are spawning excessive MySQL queries. This is certainly not unheard of - eg in the case of the various sub-forum mods, which are very inefficient and spawn *large* numbers of MySQL connections per page view.

Even some of the standard punBB features like the 'Users online' option that shows all the users currently online generate an extra MySQL load per page view. Perhaps you could review your use of some of those extra punBB options.

By optimizing how many queries your pages spawn per user page view, you may be able to cut down the number of simultaneous connections MySQL wants to open, and operate within the current limits set by your host to your usage of MySQL.

Re: How many mysql connections are normal for a standard forum?

connections != queries
Long lasting connections can cause an issue, yes, but the issue is much more likely to be host restrictions to cut down on one person hogging the connections.

Re: How many mysql connections are normal for a standard forum?

Ah, true. Sorry - I need a cofee.

But it still would do little harm to tune the query count, and examine your mods closely. Who knows how some of them are coded and are handling connections smile

The performance issues here may also be an issue with the MySQL connection timeout settings in my.cnf, viz: set-variable = wait_timeout=120 etc.