달력

07

« 2018/07 »

  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  •  
  •  
  •  
  •  

$ ulimit -a

...

open files                      (-n) 1024 <-- 기본값.

...


mysql> show global variables like '%open%';

+----------------------------+----------+

| Variable_name              | Value    |

+----------------------------+----------+

| have_openssl               | DISABLED |

| innodb_open_files          | 2000     |

| open_files_limit           | 1024     | <-- 기본값.

| table_open_cache           | 2000     |

| table_open_cache_instances | 16       |

+----------------------------+----------+

-------------------------------------------------------------------

vi /etc/profile 아래 세줄 추가.


#ulimit setting

ulimit -u 65535  # max number of process 수정

ulimit -n 65535  # open files 값 수정

-------------------------------------------------------------------

vi /etc/security/limits.conf 아래 여섯줄 추가.


*               soft    nofile          65535

*               hard    nofile          65535

root            soft    nofile          65535

root            hard    nofile          65535

mysql           soft    nofile          65535

mysql           hard    nofile          65535

-------------------------------------------------------------------

vi /lib/systemd/system/mysql.service 에서 [Service] 항목에 아래 두줄 추가.


LimitNOFILE=infinity

LimitMEMLOCK=infinity

-------------------------------------------------------------------

systemctl daemon-reload

우분투 재기동.

-------------------------------------------------------------------

mysql> show global variables like '%open%';

+----------------------------+----------+

| Variable_name              | Value    |

+----------------------------+----------+

| have_openssl               | DISABLED |

| innodb_open_files          | 2000     |

| open_files_limit           | 1048576  | <--

| table_open_cache           | 2000     |

| table_open_cache_instances | 16       |

+----------------------------+----------+


참고로, 디비 접속시 접속하는 서버의 DNS lookup 을 생략해주는게 당연히 좋습니다.

vi /etc/mysql/mysql.conf.d/mysqld.cnf


[mysqld]

skip-name-resolve



Posted by 멋지다마라송


티스토리 툴바