Sunday, December 3, 2017

lamp - mysql always using maximum connection

I have LAMP server having 4 core CPU and 32 GB RAM.We are running a large website on it. I have following issues now in my server.




  1. When I use Mysqlreport tool to monitor the mysql server i am always seeing the connection usage as below. And the users reporting connection issues in the website.



_





Connections _________________________________________________________



Max used 251 of 250 %Max: 100.40 Total 748.71k
3.5/s




But when I use "show process list" command it will output nothing. We are using MyISAM engine for all our DBs.



My Mysql Config File is pasted below:





######################

[mysqld]



max_connections = 250



set-variable=local-infile=0




datadir=/var/lib/mysql



socket=/var/lib/mysql/mysql.sock



user=mysql



skip-name-resolve



skip-bdb




wait_timeout = 60



thread_cache_size = 100



table_cache = 1024



key_buffer = 384M



log_slow_queries=/mysql-log/mysql-slow.log




query-cache-size=512M



query-cache-type=1



query_cache_limit=20M



[mysqld_safe]



log-error=/var/log/mysqld.log




pid-file=/var/run/mysqld/mysqld.pid



#


Who is using my Mysql connection pool? How can I find it?



And i have another issue.





  1. Sometimes the Load average goes beyond 4-8 range. See below:




13:40:02 up 2 days, 10:39, 0 users, load average: 5.03, 1.68, 0.93




At that time i can see mysql is the top consumer of the CPU. Is there any optimization needed in mysql Server?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...