Reputation: 2616
I am using MySQL 5.1.35 database on Linux Centos.
The Linux server has 2GB RAM with 14GB of disk space.
I have created webservices using Restlet framework in Java which has thousand user access.
I want to set max_connection for maximum concurrent connections.
So please suggest me that what max_connection
should I set?
Thanks in advance.
Upvotes: 10
Views: 24845
Reputation: 2886
This is dependent on the amount of memory you have and how your other settings are configured. There's a MySQL Calculator you can use for this.
Upvotes: 8
Reputation: 29121
You need to calculate the memory required by your MySQL engine. See manual here
If you are using MYISAM tables then you can calculate memory requirement using following formula:
key_buffer_size + (read_buffer_size + sort_buffer_size) * max_connections = K bytes of memory
Ideally this should not exceed 2 GB in your case.
Configuration parameters depends on type of your application and querys, but standard values for you could be:
key_buffer_size = 1024MB + (read_buffer_size = 1MB + sort_buffer_size = 4MB) * 200 ~= 2GB
key_buffer_size
is a global variables whereas read_buffer_size and sort_buffer_size
are session level parameters.
Upvotes: 18
Reputation: 167250
You need to give information like:
For server configuration:
You can get more info at Tuning MySQL.
Upvotes: 2