热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

MySQL(MariaDB–10.0.16MariaDB1(Debian)奇怪的性能问题

我在DualXeonCPU上运行版本10.0.16-MariaDB-1(DebianGNU/Linux8.1(jessie)),共有32个内核,128GB内存.这是一个专用的数据库

我在Dual Xeon CPU上运行版本10.0.16-MariaDB-1(Debian GNU / Linux 8.1(jessie)),共有32个内核,128 GB内存.这是一个专用的数据库服务器,最近从Percona数据库服务器迁移过来.我的配置如下所示,

################################################################################
# DATE: 19-01-2014
# DESCRIPTION: MySQL config
# RAM: 128GB RAM dedicated server
# Connections: 1000 connections
################################################################################
[mysql]
# CLIENT #
port = 1979
socket = /var/run/mysqld/mysqld.sock
[mysqld]
## Files
back_log = 300
open-files-limit = 8192
#open-files = 1024
# GENERAL #
user = mysql
default-storage-engine = InnoDB
port = 1979
socket = /var/run/mysqld/mysqld.sock
pid-file = /var/run/mysqld/mysql.pid
# DATA STORAGE #
datadir = /var/lib/mysql
# LOGGING #
log-error = /var/log/mysql/mysql-error.log
log-queries-not-using-indexes = 0
slow-query-log = 0
slow-query-log-file = /var/log/mysql/mysql-slow.log
## Per-Thread Buffers * (max_connections) = total per-thread mem usage
thread_stack = 512K #default: 32bit: 192K, 64bit: 256K
sort_buffer_size = 2M #default: 2M, larger may cause perf issues
read_buffer_size = 2M #default: 128K, change in increments of 4K
read_rnd_buffer_size = 2M #default: 256K
join_buffer_size = 2M #default: 128K
binlog_cache_size = 128K #default: 32K, size of buffer to hold TX queries
## total per-thread buffer memory usage: 17664000K = 17.250GB
## Query Cache
query_cache_size = 64M #global buffer
query_cache_limit = 2M #max query result size to put in cache
## Connections
max_cOnnections= 900 #multiplier for memory usage via per-thread buffers
max_connect_errors = 1000 #default: 10
concurrent_insert = 2
connect_timeout = 10 #default -5.1.22: 5, +5.1.22: 10
max_allowed_packet = 32M #max size of incoming data to allow
## Default Table Settings
sql_mode = NO_AUTO_CREATE_USER
## Table and TMP settings
max_heap_table_size = 1G #recommend same size as tmp_table_size
bulk_insert_buffer_size = 1G #recommend same size as tmp_table_size
tmp_table_size = 1G #recommend 1G min
tmpdir = /dev/shm #Recommend using RAMDISK for tmpdir
## Table cache settings
#table_cache = 512 #5.0.x
#table_open_cache = 512 #5.1.x, 5.5.x
query-cache-type = 1
## Thread settings
thread_cOncurrency= 32 #recommend 2x CPU cores
thread_cache_size = 400 #recommend 5% of max_connections
## InnoDB Plugin Independent Settings
innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:128M;ibdata2:10M:autoextend
innodb_log_file_size = 768M #64G_RAM+ = 768, 24G_RAM+ = 512, 8G_RAM+ = 256, 2G_RAM+ = 128
innodb_log_files_in_group = 4 #combined size of all logs <4GB. <2G_RAM = 2, >2G_RAM = 4
innodb_buffer_pool_size = 96G #global buffer
innodb_additional_mem_pool_size = 8M #global buffer
innodb_status_file #extra reporting
innodb_file_per_table #enable always
innodb_flush_log_at_trx_commit = 2
innodb_table_locks = 0 #preserve table locks
innodb_log_buffer_size = 128M #global buffer
innodb_lock_wait_timeout = 600
#innodb_thread_cOncurrency= 0
innodb_commit_cOncurrency= 8 #recommend 4x num disks
innodb_flush_method = O_DIRECT_NO_FSYNC #O_DIRECT = local/DAS, O_DSYNC = SAN/iSCSI
innodb_support_xa = 0 #recommend 0, disable xa to negate extra disk flush
innodb_fast_shutdown = 1
skip-innodb-doublewrite
skip-host-cache
# skip-name-resolve
## Binlog sync settings
## XA transactiOns= 1, otherwise set to 0 for best performance
sync_binlog = 0
## TX Isolation
#transaction-isolation = REPEATABLE-READ #REPEATABLE-READ req for ACID, SERIALIZABLE req XA
## Per-Thread Buffer memory utilization equation:
#(read_buffer_size + read_rnd_buffer_size + sort_buffer_size + thread_stack + join_buffer_size + binlog_cache_size) * max_connections
## Replication
#server_id = 1
#log_bin = /var/log/mysql/mysql-bin.log
#log_bin_index = /var/log/mysql/mysql-bin.log.index
#relay_log = /var/log/mysql/mysql-relay-bin
#relay_log_index = /var/log/mysql/mysql-relay-bin.index
#expire_logs_days = 10
#max_binlog_size = 100M
#log_slave_updates = 1
#auto-increment-increment = 2
#auto-increment-offset = 1
## Global Buffer memory utilization equation:
# innodb_buffer_pool_size + innodb_additional_mem_pool_size + innodb_log_buffer_size + key_buffer_size + query_cache_size
long_query_time = 3
innodb_checksum_algorithm=NONE
interactive_timeout = 300
wait_timeout = 40
myisam_repair_threads = 8
myisam-block-size = 8096
innodb_adaptive_hash_index = off
innodb_use_sys_malloc
innodb_sync_array_size = 4
innodb_read_ahead_threshold = 56
innodb_purge_threads = 4
innodb_adaptive_flushing = off
innodb_use_native_aio = off
innodb_random_read_ahead
optimizer_search_depth = 24
table_definition_cache = 400
table_open_cache = 2048
delay-key-write = ALL
innodb_checksum_algorithm = innodb
innodb_write_io_threads = 64
innodb_read_io_threads = 64
thread_pool_size = 16
thread_handling = pool-of-threads
innodb_disable_sort_file_cache
innodb_buffer_pool_instances = 32
innodb_adaptive_hash_index = off
[mysqldump]
quick
quote-names
max_allowed_packet = 128M

我有多个主机连接到服务器并启动查询.我面临的问题是随机数据库服务器停止接受连接.所有连接开始堆积,并在大约3或5秒后恢复正常.当我运行show processlist时,我看到很多连接正在等待连接,但由于DB服务器停止接受连接,最终连接池变满,不允许进一步连接.

在这个停电期间,我无法看到DB服务器上发生了什么,因为即使连接已经建立,我也不会给我任何信息. iostat -d -x 1不会显示磁盘异常,CPU也大多闲置. TCP连接堆积起来,因为客户端想要打开连接,因为它们需要推送数据.

我无法弄清楚这里有什么问题.这是我的数据库,机器或配置特有的东西.我在这里需要一些帮助,找出在哪里以及寻找什么来识别和纠正问题.

谢谢.

解决方法:

你的max_connect_errors太低了.你有1000.这意味着连续1000次连接失败后,你无法再连接到MySQL.
如果它快速爬升,你的状态变量Aborted_connects应该是死亡赠品.

当你无法再使用大量开放式数据库连接连接到MySQL时,你必须执行FLUSH HOSTS;并重置为count到0.

我会筹集max_connect_errors到10亿(10亿).

我还会考虑降低以下内容

[mysqld]
interactive_timeout = 30
wait_timeout = 30


推荐阅读
  • 通过CreateDirectory命令创建相应的Directory之后,可以将目录的访问权限授予其他用户,这样其他用户就能通过外部表访问很多主机上的文件,而不需要登录到数据库服务器 ... [详细]
  • 事务是通过MULTI命令开始的,在非事务状态下客户端发送的命令会被立刻执行,而在事务状态下,除了EXECWATCHDISCARD这几个命令外,redis会将命令保留在事务队列里。 ... [详细]
  • centosFedoraRHEL•整改方法:•验证检查:1、查看etclogin.defs,访谈询问当前所设置的密码长度及更换周期 ... [详细]
  • 一、问题开发中遇到将其它数据库数据插入到mysql数据库表中一直会报类似如下错误:Incorrectstringvalue:\xE6\x88\x91forcolumn ... [详细]
  • docker整体了解
    Docker是一个基于LXC技术构建的容器引擎,基于Go语言开发,遵循Apache2.0协议开源Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移 ... [详细]
  • C#使用System.Net.Mail类实现邮件发送【.Net开发】
    这篇文章介绍了C#使用System.Net.Mail类实现邮件发送的方法,文中通过示例代码介绍的非常详细。对大家的学习或工作具有一定的参考借鉴价值, ... [详细]
  • 这篇文章将为大家详细讲解有关C#开发技巧有哪些,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。C#开发技 ... [详细]
  • 导读:今天编程笔记来给各位分享关于php动态扩展怎么加载的相关内容,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: ... [详细]
  • mongodb复制集部署文档 ... [详细]
  • kepserver中文手册,kepserver使用教程,kepserver设置
    下面介绍一下KepServer模拟器的使用,以下示例使用服务器随附的Simulator驱动程序来演示创建、配置和运行项目的过程。Simulator驱动程序是基于内存的驱动程序,能为 ... [详细]
  • lazarus使用sqlite3遇到特定字符时出现乱码的Bug
    lazarus使用zeosDB控件时发现SQLite一个奇怪的现象,应用程序编译为win64时,如果输入中国2022中国时出现乱码,win32和linux64正常,开始怀疑的sql ... [详细]
  • [ipsec][strongswan]strongswan源码分析(五)plugin的配置文件的添加方法与管理架构解析
    我们知道,strongswan是基于插件式管理的。不同的插件有不同的配置文件,在这下面,我们以netlink的插件为例:etcstrongswan.dcharonkernel-ne ... [详细]
  • 文章目录前言必知必会的软件服务器分类机架式服务器塔式服务器刀片式服务器三者的区别虚拟服务器(云服务器)服务器的硬件组成服务器常见的品牌前言本文是循序渐进学linux的第一课,为 ... [详细]
  • 开发笔记:深度探索!Android之OkHttp网络架构源码解析
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了深度探索!Android之OkHttp网络架构源码解析相关的知识,希望对你有一定的参考价值。 ... [详细]
  • CAS介绍CAS(CentralAuthenticationService),是耶鲁大学开发的单点登录系统(SSO,singlesign-on),应用广泛,具有独立于平台的,易于理解,支持代 ... [详细]
author-avatar
黄晓敏3023
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有