Mysql thread connected is 1-3 but experienced too many connections -
yesterday can see in log within 1 minute timespan, there alot of mysql errors many connections failures. running default setting: 151 max_connections , have not experienced before.
when checking current state, thread connections 1 , 3 @ max.
should increase max_connections or did temporary suffer ddos?
note: solved , worked after minute.
update 2: happend again. can see multiple errors within seconds timeframe error log. why happen?
decrease max_connect_errors
to, say, 100. small protection against hackers.
threads_running
@ least 1
because includes show
.
with max_connections = 151
, max_used_connections = 152
means 151 user connections came in, plus 1 "extra" connection allowed , used. reason, not run application root
(or other super
user).
grant ... on your_database.* ...
, not ... on *.* ...
application logins. slows down hackers getting @ mysql
database.
root
should allowed localhost
. safety measure.
if web server has "access" log, @ it. may see hundreds of similar looking hack attacks in row. , may similar set of them often.
be sure escape data coming html forms. build inserts
. without this, wide open attack.
addenda
select user, host mysql.user super_priv = 'y';
will show has super
. first cut, should include host
values of localhost
, 127.0.0.1
, or ::1
, of localhost. not prevent hackers first hacking client, may on localhost.
this may list way in:
select user, host mysql.user grant_priv = 'y';
back question
the web server's (nginx's?) limit on number of connections should less mysql's max_connections
. stop hackers (and users) @ door, rather letting them clog both web server , mysql.
even on running system, 20 reasonable max how many should allowed web server simultaneously. if there more, stumbling on each other; better let few resources need rather take longer because of battling on resources.
Comments
Post a Comment