{{tag>mysql ubuntu limits}}

====== Open Files Limit ======

===== Проверить =====

  # ulimit -Ha
  time(seconds) unlimited
  file(blocks) 2097151
  data(kbytes) unlimited
  stack(kbytes) unlimited
  memory(kbytes) unlimited
  coredump(blocks) unlimited
  nofiles(descriptors) unlimited

  # ulimit -Sa
  time(seconds) unlimited
  file(blocks) 2097151
  data(kbytes) 131072
  stack(kbytes) 32768
  memory(kbytes) 32768
  coredump(blocks) 2097151
  nofiles(descriptors) 2000

===== Изменить =====

nano /etc/security/limits.conf

<code sh>
* soft nofile 102400
* hard nofile 102400
* soft nproc 10240
* hard nproc 10240
</code>

Заместо * можно указать название сервиса 

<code sh>
mysql soft nofile 102400
mysql hard nofile 102400
mysql soft nproc 10240
mysql hard nproc 10240
</code>