mariadb 无法创建线程池线程

rnmwe5a2  于 2023-01-20  发布在  其他
关注(0)|答案(1)|浏览(178)

我们在MariaDb服务器上收到了这个警告,以前从未见过
警告:无法创建线程池线程:资源暂时不可用,池中的当前线程数为12
谷歌是没有帮助的,在这个时候与聊天GPT是下降!
服务器运行正常,我们没有看到任何错误
你知道这可能是什么吗?

更新:

从报告来看,我们没有看到内存使用量出现任何峰值。
我们的CNF文件:

[mysqld]
log-bin
server-id       = 1

skip-external-locking
skip-name-resolve = 1
innodb_file_per_table = 1

innodb_flush_log_at_trx_commit = 2
innodb_flush_method=O_DIRECT
key_buffer_size               = 64K  
max_allowed_packet            = 1G 
thread_stack                  = 292K 
thread_cache_size             = 64 
table_open_cache              = 16000 
table_definition_cache        = 9000  ##  ((table_open_cache+400)/2)
innodb_change_buffer_max_size = 5 

join_buffer_size        = 256K 
max_connections         = 4000 

innodb_buffer_pool_size = 80G 
innodb_log_file_size    = 8G 

# Rolando :
innodb_log_buffer_size  =16M
innodb_read_io_threads  =12
innodb_write_io_threads =12
net_buffer_length       =1M

# Remove the STRICT_TRANS_TABLES which was added as default by MariaDB After 10.2.4
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

tmp_table_size                 = 768M 
max_heap_table_size            = 768M

#maximum size of a single resultset in the cache.
query_cache_limit              = 2M

#maximum amount of data that may be stored in the cache
query_cache_size               = 0
query_cache_type               = 0

# EXPERIMENTAL
# To be confirmed  instead of one-thread-per-connection
thread_handling=one-thread-per-connection  # thread_handling=pool-of-threads
innodb_flush_neighbors=0
innodb_io_capacity=800 ## was 1600
# END EXPERIMENTAL

#  deadlock error
transaction-isolation = READ-COMMITTED
binlog_format = row
innodb_autoinc_lock_mode = 2

log_bin           = /logs/mysql/mysql-bin.log
expire_logs_days  = 2
binlog_cache_size = 16M

#Slow query
log_output=FILE
slow_query_log
slow_query_log_file=/logs/mysql/slow-query.log
long_query_time=10.0

ignore-db-dir=lost+found

## Adding Performance_schema
innodb_monitor_enable=all
performance_schema=ON
performance-schema-instrument='stage/%=ON'
performance-schema-consumer-events-stages-current=ON
performance-schema-consumer-events-stages-history=ON
performance-schema-consumer-events-stages-history-long=ON
wvt8vs2t

wvt8vs2t1#

错误来自此代码区域。
“资源暂时不可用”是尝试创建线程时出现的操作系统错误。
如果我们查看pthread_create,则EAGAIN错误指示以下潜在原因:

  • EAGAIN资源不足,无法创建另一个线程。(这将导致内存不足)
  • EAGAIN遇到系统强加的线程数限制。有许多限制可能会触发此错误:已达到RLIMIT_NPROC软资源限制(通过setrlimit(2)设置),该限制限制真实的用户ID的进程和线程数量;已达到内核对进程和线程数量的系统范围限制/proc/sys/kernel/threads-max(请参阅proc(5));或已达到PID的最大数量/proc/sys/kernel/pid_max(请参见proc(5))。

虽然systemd确实有一个LimitNPROC,但它不是默认设置的,而且在当前线程数为12的情况下,它看起来很小,所以我猜它的内存不足。

相关问题