increase the MySQL connections

jestin_virtual

Verified User
Joined
Aug 27, 2009
Messages
5
Hello !

i have only 1 website on the server , the website have more than 300 visitors online at the same time !

Sometimes a MYSQL warning appears on the index page !

i have submitted the post to know , is there any limit for MYSQL connection ? as i told we have only one website on the server and it`s possible to increase the MySQL connections !!
 
Last edited:
Hi there, you would need to edit the my.cnf file located in /etc directory. Under the [mysqld] section, put the following im:

max_connections=xxx

Then, save and restart the mysql daemon. One note though, even with 300 people online at a time, an sql query should only last micro seconds, so, even with that many people online, it is very rare that you would hit the max number. It may be worth looking at your configuration to speed up queries. As an example, the max limit on one of my servers is set to 300, and I can have a few thousand people online at some times.
 
Hi there, you would need to edit the my.cnf file located in /etc directory. Under the [mysqld] section, put the following im:

max_connections=xxx

Then, save and restart the mysql daemon. One note though, even with 300 people online at a time, an sql query should only last micro seconds, so, even with that many people online, it is very rare that you would hit the max number. It may be worth looking at your configuration to speed up queries. As an example, the max limit on one of my servers is set to 300, and I can have a few thousand people online at some times.

Hi , please check the below setting and let me know where should be change ! and also what is the best choose ,


[root@server etc]# cat my.cnf
[mysqld]
local-infile=0
[root@server etc]#
 
There are some template my.cnf files located at /usr/share/mysql, on most systems. The template files are called:

my-small.cnf
my-meduim.cnf
my-large.cnf
my-huge.cnf

Open them up to find the information on them. Once you decide on a file to use, backup your current my.cnf:

mv /etc/my.cnf /etc/my.cnf.backup1

Then, copy the file from the /usr/share/mysql directory, which ever one you decide:

cp /usr/share/mysql/my-huge.cnf /etc/my.cnf

Of course, restart the mysql daemon once the file has been copied:

/etc/init.d/mysql restart

Hope that helps.
 
Back
Top