{"id":316,"date":"2017-09-21T11:12:00","date_gmt":"2017-09-21T02:12:00","guid":{"rendered":"http:\/\/jook.pe.kr\/?p=316"},"modified":"2017-09-21T11:12:00","modified_gmt":"2017-09-21T02:12:00","slug":"ubuntu-16-04-mysql-max_connections-%ec%88%98%ec%a0%95","status":"publish","type":"post","link":"http:\/\/jook.pe.kr\/?p=316","title":{"rendered":"Ubuntu 16.04 mysql max_connections \uc218\uc815"},"content":{"rendered":"<p>Ubuntu 16.04 \uc5d0\uc11c mysql max_connections \uac12\uc744 \uc218\uc815\ud558\uba74 \ucd5c\ub300\uac12\uc774 214 \uc774\uc0c1 \ub298\uc5b4\ub098\uc9c0 \uc54a\ub294 \uacbd\uc6b0\uac00 \ubc1c\uc0dd\ud55c\ub2e4.. \u3160\u315c<\/p>\n<p>\uc774 \uacbd\uc6b0\ub294 mysql.service\uc758 \u00a0open file limit \uac12\uc744 \ub298\ub824 \uc8fc\uba74 \ub41c\ub2e4.<br \/>\n1. \/etc\/mysql\/mysql.conf.d\/mysqld.cnf \ud30c\uc77c\uc5d0\uc11c max_connections \uac12\uc744 \uc218\uc815\ud574 \uc900\ub2e4.<\/p>\n<p>max_connections\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = 512<\/p>\n<p>mysql service\ub97c restart \ud574\ub3c4 max_connections \uac12\uc740 214\ub85c \ud655\uc778\ub41c\ub2e4.<\/p>\n<p>mysql&gt; show variables like &#8216;max_connections&#8217;;<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+<br \/>\n| Variable_name\u00a0\u00a0 | Value |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+<br \/>\n| max_connections | 214\u00a0\u00a0 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+<br \/>\n1 row in set (0.00 sec)<\/p>\n<p>mysql&gt;<br \/>\n2. \/lib\/systemd\/system\/mysql.service \uc81c\uc77c \ud558\ub2e8\uc5d0 LimitNOFILE \uac12\uc744 \ucd94\uac00\uc785\ub825\ud55c\ub2e4.<\/p>\n<p>root@localhost:~# cat \/lib\/systemd\/system\/mysql.service<br \/>\n# MySQL systemd service file<\/p>\n<p>[Unit]<br \/>\nDescription=MySQL Community Server<br \/>\nAfter=network.target<\/p>\n<p>[Install]<br \/>\nWantedBy=multi-user.target<\/p>\n<p>[Service]<br \/>\nUser=mysql<br \/>\nGroup=mysql<br \/>\nPermissionsStartOnly=true<br \/>\nExecStartPre=\/usr\/share\/mysql\/mysql-systemd-start pre<br \/>\nExecStart=\/usr\/sbin\/mysqld<br \/>\nExecStartPost=\/usr\/share\/mysql\/mysql-systemd-start post<br \/>\nTimeoutSec=600<br \/>\nRestart=on-failure<br \/>\nRuntimeDirectory=mysqld<br \/>\nRuntimeDirectoryMode=755<br \/>\nLimitNOFILE=65535<br \/>\n3. systemd reload \/ mysql service restart<\/p>\n<p>root@localhost:~# systemctl daemon-reload<br \/>\nroot@localhost:~# systemctl restart mysql.service<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 16.04 \uc5d0\uc11c mysql max_connections \uac12\uc744 \uc218\uc815\ud558\uba74 \ucd5c\ub300\uac12\uc774 214 \uc774\uc0c1 \ub298\uc5b4\ub098\uc9c0 \uc54a\ub294 \uacbd\uc6b0\uac00 \ubc1c\uc0dd\ud55c\ub2e4.. \u3160\u315c \uc774 \uacbd\uc6b0\ub294 mysql.service\uc758 \u00a0open file<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"gallery","meta":{"footnotes":""},"categories":[5,6],"tags":[],"_links":{"self":[{"href":"http:\/\/jook.pe.kr\/index.php?rest_route=\/wp\/v2\/posts\/316"}],"collection":[{"href":"http:\/\/jook.pe.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jook.pe.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jook.pe.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/jook.pe.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=316"}],"version-history":[{"count":0,"href":"http:\/\/jook.pe.kr\/index.php?rest_route=\/wp\/v2\/posts\/316\/revisions"}],"wp:attachment":[{"href":"http:\/\/jook.pe.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jook.pe.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jook.pe.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}