Ir al contenido principal

MySQL Server Error – “Can’t Create A New Thread (errno 11)”

 

MySQL Server Error – “Can’t Create A New Thread (errno 11)”

OS error 11 is “Resource temporarily unavailable”. The most common cause of receiving this error when trying to create a new thread is having hit the process’s kernel enforced a limit on open file descriptors. The second most common cause is having hit the process’s kernel enforced limit on the number of processes/threads.

Here are the factors involved:

  1. The system-wide limits: sysctl -e fs.file-max && sysctl -e kernel.threads-max
  2. The per-process limits (in a *new* shell): ulimit -n, grep nofile /etc/security/limits.conf and ulimit -u, grep nproc /etc/security/limits.conf.
  3. The open_files_limit setting in mysqld (mysql> show global variables like “open_files_limit”;).
  4. The other settings within mysqld that can affect the number of open FDs and threads that the process may use (max_connections, thread_cache_size, table_open_cache, table_definition_cache, innodb_open_files, etc.)

Assuming that it was in fact that we hit the open-files-limit, which defaults to 1024 on most Linux systems – we should be able to avoid the issue by taking these steps:

1. Increasing the explicit open files limit in mysqld by making this change to the my.cnf file:

[mysqld]

# Here X could be (max_connections+table_cache)*3  OR you could simply set it very high, for example 32000
open-files-limit = X 

2. Restart mysqld service:

/etc/init.d/mysql restart

NPROC limits

If it instead appears that the nproc limit is the cause (CentOS 6 puts a low limit on this in /etc/security/limits.conf), then we can increase the nproc limit in a few different ways.

1. Edit limits.conf:

We can set the limits for the mysql user in the limits.conf file, for example:

mysql soft nproc 10240
mysql hard nproc 40960

Note that limits.conf only applies to login shells and does not affect processes started by init or systemd. Any changes to limits.conf will only apply to new logins, you must log out and log in to start a new session.

2. Edit the mysqld_safe script:

We can also simply add a ulimit call near the top of the mysqld_safe script, for example:

$ ulimit -u 40000

3. Use a wrapper script:

Refer below post on “How to use a Wrapper Script to set Custom Per-Process Attributes for MySQL Server”.

We will need to restart mysqld in order for the changes to take effect.

Comentarios

Entradas más populares de este blog

The Elder Scrolls III: Morrowind - Edición Juego del Año

  The Elder Scrolls III: Morrowind - Edición Juego del Año JUEGO COMPLETO PARA PC DISPONIBLE EN GOG.COM Morrowind es un RPG para un jugador, épico y de final abierto, que te permite crear cualquier tipo de personaje imaginable y jugar con él, y está disponible para los miembros KEY: QLZ627B0FD65E0541F SPARTAN!!! APOYEN DANDO LIKE A MIS REDES SPARTAN.!! #FREEGAMES #GAMING #JUEGOS #PCGAMING #JUEGOSGRATIS #SPARTAN #SPARTANFREE #TWITCH #GRACIASTOTALES #VTUBER #FREE #HAPPY #REGIO #GAMES #GAMER #GAMERS #GAMEOVER #FOLLOWTOFOLLOW #PROJECTFREE #GRATIS #JUEGOSGRATIS #FREESPARTAN #GIFTGAMES #KEYGAME #SERIALJUEGO SIGANME!!! youtube.com/@thespartanfreegames Se vienen juegos nuevos!!!! GRACIAS TOTALES! New games are coming!!!!

Procesadores INTEL

  El diseño de procesadores no es un asunto baladí. Su complejidad creciente ha traído que la creación de una nueva arquitectura dure años (al menos, unos cuatro o cinco). La complejidad de los primeros procesadores de Intel se fundamentaba en resolver cosas que apenas se estaban descubriendo en los laboratorios de la empresa. Hoy la complejidad se centra en las funcionalidades necesarias para satisfacer las demandas de rendimiento, características y seguridad (entre otras) de los usuarios. Luego de los éxitos del Intel 4004 y el Intel 8008, la empresa, de la mano del Dr. Federico Faggin, continuó con el desarrollo de la siguiente versión del procesador de 4 bits, para presentar en 1974, el Intel 4040. Se trató de un procesador de 10 µm que integró 3,000 transistores y que era capaz de ejecutar ~62 kIPS (miles de instrucciones por segundo) y ~1.2 kFLOPS (operaciones matemáticas por segundo). El bus y su conjunto de instrucciones eran idénticos al del 4004 y agregó algunas líneas e ...