Database connections are opened and closed pretty quickly (typically a fraction of a second). It’s highly unlikely you’ll have a large number of connections to the database open at one time. Let’s see if I can explain. When a visitor visits a page, WordPress queries the database to get the content to display, once the content is captured the database connection is termminated. Then the page is built serverside and displayed in the visitors browser. It’s highly unlikely you’d need multiple users, and I’ve never heard of anyone setting up the config to do that.
Now, you can look at using a caching plugin to store the pages as static on the server. This will reduce the load on the server as well as the database queries. I hope this helps!
Thread Starter
SK
(@sooskriszta)
Thanks Tim! I am using WP Super Cache to cache pages as static, and hopefully that takes care of database connections in normal circumstances.
However, I am planning to install bbPress and BuddyPress, which more or less breathe dynamic content and are not very conducive to static caching.
Further, BuddyPress wipes out entire WordPress cache everytime someone logs in.
Finally, since the last update of WordPress, static caching plugins, including WP Super Cache, have been having trouble delivering on the promised caching.
These are the reasons I am wondering about multiple users…
I work for a large hosting company, and it’s rare that I’ve seen a website owner have excessive MySQL connections since they only last a fraction of a second. However, I’m not aware of any way to have multiple users attached to one database. Furthermore, WordPress would have no way to know which user to connect with like a load balancing system would.
You could do it by setting all the users as variables. Then you’d need a code a script to rotate the user based on a sequential loop. That way, the script would change the username and password based on the variable passed to it, as the wp-config file is called.
This is only theory, and I’ve never found a need to do this or attempt to code it. I’d suggest talking to your hosting provider further since this problem seems to be isolated.
Thread Starter
SK
(@sooskriszta)
I see. Thanks for the advice. I’ll go ahead and install bbPress and BuddyPress and see what happens…based on what you have told me, hopefully it won’t crash my website 🙂
Your host should be monitoring the connections and notify you if there’s an issue with using too much resources. Most hosts don’t mind doing this, since typically this means you’ll need to upgrade the kind of hosting package you’re using. I hope this helps!