mysql my.cnf优化
[mysqld]
lower_case_table_names = 1
sql_mode = STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
skip_name_resolve = 1
character_set_server = utf8
collation_server = utf8_unicode_ci
back_log = 300
max_connections = 1000
max_connect_errors = 100000
interactive_timeout = 600
wait_timeout = 600
table_open_cache = 2048
query_cache_type = OFF
query_cache_size = 0
query_cache_limit = 8M
thread_cache_size = 51
max_allowed_packet = 16M
tmp_table_size = 256M
max_tmp_tables = 128
max_heap_table_size = 256M
sort_buffer_size = 256M
read_buffer_size = 256M #顺序IO
join_buffer_size = 256M
read_rnd_buffer_size = 256M #随机IO
bulk_insert_buffer_size = 256M #
open_files_limit = 65536
default_storage_engine = InnoDB
expire_logs_days = 1
slow_query_log = 1
long_query_time = 1
log_output = FILE
log_queries_not_using_indexes = 1
server_id = 1013306
#binlog_format = mixed
#log_slave_updates = 1
#max_binlog_files=100
#max_binlog_cache_size = 1024M
#max_binlog_size = 1024M
#binlog_cache_size = 4M
sync_binlog = 0
#innodb
innodb_buffer_pool_instances = 16
innodb_buffer_pool_size = 8G
innodb_buffer_pool_dump_pct = 75
innodb_page_cleaners = 8
innodb_log_file_size = 512M
innodb_log_files_in_group = 2
innodb_log_buffer_size = 32M #default 16M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 30
innodb_thread_concurrency = 30
innodb_undo_logs = 128 #must >=35.default 128
innodb_undo_tablespaces = 0 #must >=2
innodb_undo_log_truncate = 1
innodb_max_undo_log_size = 1000M
innodb_purge_rseg_truncate_frequency = 128
innodb_print_all_deadlocks = 1
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_open_files = 65536
innodb_file_per_table = 1
innodb_lock_wait_timeout = 30
innodb_read_io_threads = 8
innodb_write_io_threads = 8
innodb_io_capacity = 2000
innodb_io_capacity_max = 4000
innodb_flush_method = O_DIRECT
innodb_purge_threads = 4
innodb_support_xa = 1
innodb_max_dirty_pages_pct = 75
transaction_isolation = REPEATABLE-READ
show_compatibility_56 = on
innodb_sort_buffer_size = 16M
#rep
slave-parallel-type = LOGICAL_CLOCK
slave-parallel-workers = 16
master_info_repository = TABLE
relay_log_info_repository = TABLE
relay_log_recovery = ON
slave_skip_errors = ddl_exist_errors
[mysqldump]
max_allowed_packet = 16M
[mysql]
default_character_set = utf8
[mysqld]
#validate_password
plugin-load = validate_password.so
validate_password_policy = 1
validate-password = FORCE_PLUS_PERMANENT
mysql my.cnf优化的更多相关文章
- MYSQL数据库的优化
我们究竟应该如何对MySQL数据库进行优化?下面我就从MySQL对硬件的选择.MySQL的安装.my.cnf的优化.MySQL如何进行架构设计及数据切分等方面来说明这个问题. 服务器物理硬件的优化 在 ...
- MySQL数据库的优化(上)单机MySQL数据库的优化
MySQL数据库的优化(上)单机MySQL数据库的优化 2011-03-08 08:49 抚琴煮酒 51CTO 字号:T | T 公司网站访问量越来越大,导致MySQL的压力越来越大,让我们自然想到的 ...
- [转]MySQL数据库的优化-运维架构师必会高薪技能,笔者近六年来一线城市工作实战经验
本文转自:http://liangweilinux.blog.51cto.com/8340258/1728131 年,嘿,废话不多说,下面开启MySQL优化之旅! 我们究竟应该如何对MySQL数据库进 ...
- mysql笔记05 优化服务器设置
优化服务器设置 1. MySQL有大量可以修改的参数--但不应该随便去修改.通常只需要把基本的项配置正确(大部分情况下只有很少一些参数时真正重要的),应将更多时间花在schema的优化.索引,以及查询 ...
- MySQL数据库性能优化的关键参数(转)
我们在进行数据库管理和开发中经常会遇到性能问题,这就涉及到MySQL的性能优化.通过在网络上查找资料和笔者自己的尝试,我认为以下系统参数是比较关键的: 关键参数一:back_log 要求 MySQL ...
- Mysql线程池优化笔记
Mysql线程池优化我是总结了一个站长的3篇文章了,这里我整理到一起来本文章就分为三个优化段了,下面一起来看看. Mysql线程池系列一(Thread pool FAQ) 首先介绍什么是mys ...
- MYSQL之性能优化 ----MySQL性能优化必备25条
今天,数据库的操作越来越成为整个应用的性能瓶颈了,这点对于Web应用尤其明显.关于数据库的性能,这并不只是DBA才需要担心的事,而这更是我 们程序员需要去关注的事情.当我们去设计数据库表结构,对操作数 ...
- MySQL数据库的优化-运维架构师必会高薪技能,笔者近六年来一线城市工作实战经验
原文地址:http://liangweilinux.blog.51cto.com/8340258/1728131 首先在此感谢下我的老师年一线实战经验,我当然不能和我的老师平起平坐,得到老师三分之一的 ...
- Mysql监控及优化
一.Mysql连接数 1.配置Mysql连接数: vim /etc/my.cnf [mysqld]下面修改 max_connections=1000 不写默认为100. wait_timeout=60 ...
随机推荐
- java io之管道流
一.java.io中存在一中流叫管道流,类似管道的功能.PipedOutputStream和PipedInputStream分别是管道输出流和管道输入流.这个两个流必须同时使用. 二.作用:进行两个线 ...
- 微信小程序从子页面退回父页面时的数据传递 wx.navigateBack()
我们知道,在微信小程序中,从一个页面转到另一个页面,一般情况下可以通过navigate或redirect时候的url来携带参数,然后在目标页面的onLoad函数参数中获取这些url参数.例如: // ...
- leetcode395
分治法. public class Solution { private int LongestSubstringSub(string s, int k, int start, int end) { ...
- PS7.0快捷键和使用技巧
选择工具:矩形.椭圆选框工具 [M]裁剪工具 [C]移动工具 [V]套索.多边形套索.磁性套索 [L]魔棒工具 [W] 编辑工具:修复画笔.修补工具 [J]画笔.铅笔工具 [B]橡皮图章.图案图章 [ ...
- 13 并发编程-(线程)-异步调用与回调机制&进程池线程池小练习
#提交任务的两种方式 #1.同步调用:提交完任务后,就在原地等待任务执行完毕,拿到结果,再执行下一行代码,导致程序是串行执行 一.提交任务的两种方式 1.同步调用:提交任务后,就在原地等待任务完毕,拿 ...
- 创建maven版的java工程
步骤如下: 1.第一步 2.第二步: 3.第三步:
- ubuntu apt-get 代理
# cat /etc/apt/apt.conf Acquire::http::Proxy "http://109.105.4.17:8119"; Acquire::https::P ...
- 新手C#int.Parse、int.TryParse的学习2018.08.04
int.Parse()用于将字符串转换为32为int类型,但是在遇到非数字或者类似1.545这种小数的时候会报错,后来采用了int.TryParse,这个在转换后会判断是否可以正常转换,若不能,会返回 ...
- C++ 文件类型分析
.APS:存放二进制资源的中间文件,VC把当前资源文件转换成二进制格式,并存放在APS文件中,以加快资源装载速度.资源辅助文件. .BMP:位图资源文件. .BSC:浏览信息文件,由浏览信息维护工具( ...
- SQLite介绍
优点:轻量级.绿色组件.单一文件.跨平台.查询效率极高.使用事务插入速度极快.支持limit分页. 适合查询速度要求较高,内存占用较少的场合,尤其是嵌入式操作系统,如各种手机操作系统,低并发web(9 ...