• I have a MariaDB server runing 10 databases/users used for 10 different WordPress sites.

    I wanna limit the resources so 1 site doesn’t consumes it all. And i think the max connections and max user connections is the variable i should play with.

    So my main question is does “max connections” (default 151) limit the connections to each database or is it shared with all databases on the server?

    And how do the max_user_connections varible work, is it connections per ip address that request data?

    My goal is to limit the each WordPress site from using to much resources and i wanna limit the database connections to a minimum for each site.

    Any help is much appreciated!

    • This topic was modified 2 years, 7 months ago by Jan Dembowski.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Your question is less about WordPress as software and more about the database server you are using. The parameters mentioned belong to MariaDB, which is why you can’t say much about it here in this forum. My advice would be to ask this question in a forum for databases.

    Keep in mind: if you restrict to the kind of database connections, this could have a negative effect on the accessibility of individual pages. A more effective way would be to see why one web page requires more resources than others. In WordPress language, you should check if all the plugins that the project in question uses are really necessary. If necessary, you can also get more performance out by using caching plugins and also relieve the database.

    One tip though: if you have a monitoring tool, you could check how many database connections each website opens.

    Dion

    (@diondesigns)

    The global max_user_connections variable sets the maximum number of simultaneous connections for a database user. If your 10 sites have 10 different DB users, then this is the variable that can potentially limit each user’s DB usage.

    If max_connections is set to 151, then for 10 DB users, the global max_user_connections variable should be set to 15. That’s a bit low for WordPress, but it’s a good starting point, and you can fine-tune on a user-by-user basis if individual sites have issues. (Check the MySQL and phpMyAdmin documentation for how to do that.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit database connections from wordpress sites’ is closed to new replies.