How to Modify Max User Connections on VPS and Dedicated Servers

Max User Connections Hero Image

Occasionally, you may find yourself in a situation where you need to allow additional simultaneous connections to your MySQL database server. You may need to add more connections in order to accommodate an increased load from your database server or handle increased web traffic caused by search bots,

By default, all InMotion Hosting servers allow 20 concurrent connections. To change this setting you will need to modify the database configuration file (my.cnf), which can only be accessed using root access on VPS or dedicated servers. In this article, we will outline how to find and modify the my.cnf file to increase the max_user_connections value on VPS and dedicated servers.

Know you’ll always be able to reach your customers when they need you with our Dedicated Hosting Services.

Modifying Max User Connections

  1. First, log into your server via SSH.
  2. Once logged in, type the following command to change the directory to the /etc folder as follows:

    cd /etc

  3. While in the /etc folder, you can see the contents of the folder by typing:

    ls -alh

    You will need open the my.cnf file for editing using a command-line text editor such as nano or vim. You can use:

    nano my.cnf

    or

    vim my.cnf

    Note: If you’re not familiar with either editor, make sure to review a guide on using nano or vim. You can also use the man command like this to get a help file directly from SSH: man nano or man vim.

  4. While editing the my.cnf file, locate the following setting:
    max_user_connections=20
  5. Once you have located the correct setting, change the value to the desired number of max connections. For example:
    max_user_connections=50

  6. Finally, save the changes and exit the text editor.

Now that you have increased the max_user_connection value by modifying the my.cnf file, your MySQL database server will be able to maintain more simultaneous connections.

This is particularly useful for websites that require a large number of database queries or searches, in order to function. It is important to note that setting this value too high can have adverse effects on the performance of the site. As such, it is crucial to find the optimal value that allows you the number of connections you need while avoiding placing too much stress on available system resources.

If you need help monitoring the performance of your database server, please check out our article that explains how to monitor MySQL performance.

Scale your business with high-performance dedicated hosting. Choose from Managed Dedicated Servers powered by cPanel, or select a Bare Metal Server for complete server control via the command line.

DDoS Protection    99.99% Uptime    Software RAID    New Customer Discounts

Explore Dedicated Hosting

InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

Was this article helpful? Let us know!