Personal tools

Too many Connections

From TrueERP wiki

Jump to: navigation, search

Overview

This is a warning that is generated when the number of people or machines connecting to MySQL has exceeded the base allocation

The number of connections permitted is controlled by the max_connections system variable. The default value is 250 to improve performance. If you need to support more connections, you should set a larger value for this variable.


The maximum number of connections MySQL can support depends on the quality of the thread library on a given platform, the amount of RAM available, how much RAM is used for each connection, the workload from each connection, and the desired response time. You should be able to support 500 to 1000 simultaneous connections routinely and as many as 5,000 connections if you have many gigabytes of RAM available and the workload from each is low or the response time target undemanding.


To adjust this setting, on your TrueERP server, Stop the MySQL_ERP service by opening the windows services menu and selecting the MySQL_ERP service, then select stop.

Now edit the "myERP.ini" file that you will find on your TrueERP server under "C:\MySQL_ERP\bin\myERP.ini" using notepad, ie find the file then right mouse click and open with notepad.


When you open the file you will see a section with this text in it.

# The MySQL server
[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
port = 3309
socket = /tmp/mysql.sock
skip-host-cache
skip-name-resolve
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 64M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
basedir="C:\MySQL_ERP"
datadir="C:\MySQL_ERP\data"


You need to add the line. "set-variable = max_connections=1000" like so.


# The MySQL server
[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
port = 3309
socket = /tmp/mysql.sock
skip-host-cache
skip-name-resolve
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 64M
set-variable = max_connections=1000
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
basedir="C:\MySQL_ERP"
datadir="C:\MySQL_ERP\data"


Now restart the MySQL_ERP service and you are good to go.