Mysql load error
-
Hello
http://prntscr.com/112m1asload average: 7.46, 5.22, 4.62
mysql is loading. I wonder if anyone has a solution to this?
CWP : nginx + varnish + apache + php7.2 fpm
Vps: 6 cpu + 24ram
what would you suggest me to do? thanks.
-
its hard to determine by only watching the screenshot.
probably you've high traffic or ddos.
-
you can try to optimize mysql by below values in
/etc/my.cnf
[mysqld] max_connections = 6000 max_user_connections=300 innodb_lock_wait_timeout=120 max_heap_table_size = 1G tmp_table_size = 1024M thread_cache_size = 128 innodb_buffer_pool_size = 1G innodb_log_file_size = 1G innodb_buffer_pool_instances = 4 table_open_cache = 3000 wait_timeout=110 interactive_timeout=110 long_query_time=25 max_allowed_packet=128M
-
@sandeep said in Mysql load error:
max_connections = 6000
max_user_connections=300
innodb_lock_wait_timeout=120
max_heap_table_size = 1G
tmp_table_size = 1024M
thread_cache_size = 128
innodb_buffer_pool_size = 1G
innodb_log_file_size = 1G
innodb_buffer_pool_instances = 4
table_open_cache = 3000
wait_timeout=110
interactive_timeout=110
long_query_time=25
max_allowed_packet=128MFirstly, thank you.
cd /etc/my.cnf.d
nano server.cnf[mysqld]
I added below it. Did I do it right?===========================================
http://prntscr.com/112urusAlso, when I look from here. I see such errors. I guess the attack comes from Memcached. but I did not install memcached.
I see it working with the command "service memcached status".How can I completely remove memcached from the server?
Apr 3 04:52:03 vm6065100 kernel: Firewall: UDP_IN Blocked IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:dd:7c:1c:f1:f6:cf:61:08:00 SRC=68.119.123.131 DST=MY-İP LEN=43 TOS=0x00 PREC=0x00 TTL=52 ID=24444 PROTO=UDP SPT=3074 DPT=11211 LEN=23
-
@choqo i mentioned to add this to
/etc/my.cnf
you can also add it there
/etc/my.cnf.d/server.cnf
but recommended is to add in the/etc/my.cnf
if you get error then its possible you've some sort custom added previously and wrongly added. you'll never get errors with this mysqld configs
you can secure memcached from UDP attacks :
https://www.mysterydata.com/how-to-secure-memcached-server-from-udp-attacks/ -
@sandeep
thank you so much