expire_logs_days
设置二进制日志的保留时间 expire_logs_days=n, “n”就是保留最近“几天”的日志信息,之前的就都删掉, set global expire_logs_days=30; 每次产生新的mysql_bin或者重启mysql的时候生效; 在压力比较大的mysql上或生产环境,我们不应该启动这个参数(my.cnf中不显式设置该参数或设置expire_logs_days=0):mysql每天产生十几个或更多的binlog文件,启用这个参数后,一次清理这么多文件,必定会导致磁盘io被占满,mysql出现抖动或hang住。因此建议自己编写脚本,每次purge完一个binlog后,sleep几秒 |
lower_case_table_names
1: 不区分表明的大小写; 0:区分表明的大小写; 注意: 改这个值得时候要注意,如果这个值之前为0 ,要改成1,需要将之前有大写的表明更改成小写。 否则服务重启后,这些有大写的表明将无法识别 |
have_query_cache
表示当前版本的MYSQL是否支持Query Cache
query_cache_size
MYSQL的查询缓存用于缓存select查询结果,并在下次接收到同样的查询请求时,不再执行实际查询处理而直接返回结果,有这样的查询缓存能提高查询的速度,使查询性能得到优化,前提条件是你有大量的相同或相似的查询,而很少改变表里的数据,否则没有必要使用此功 能。可以通过Qcache_lowmem_prunes变量的值来检查是否当前的值满足你目前系统的负载。注意:如果你查询的表更新比较频繁,而且很少有 相同的查询,最好不要使用查询缓存。thread_cache_size
这个值表示可以重新利用保存在缓存中线程的数量,当断开 连接时如果缓存中还有空间,那么客户端的线程将被放到缓存中,如果线程重新被请求,那么请求将从缓存中读取,如果缓存中是空的或者是新的请求,那么这个线 程将被重新创建,如果有很多新的线程,增加这个值可以改善系统性能.通过比较 Connections 和 Threads_created 状态的变量,可以看到这个变量的作用。(?>表示要调整的值) 根据物理内存设置规则如下: 1G ―> 8 2G ―> 16 3G ―> 32 >3G ―> 64 |
table_open_cache
|
innodb_additional_mem_pool_size
这个参数我们平时调整的可能不是太多,很多人都使用了默认值,可能很多人都不是太熟悉这个参数的作用。 这个参数大小是否足够还是比较容易知道的,因为当过小的时候,MySQL 会记录 Warning 信息到数据库的 error log 中,这时候你就知道该调整这个参数大小了。 |
tmp_table_size
- mysql 的配置文件中,tmp_table_size 的默认大小是 32M。
- 如果一张临时表超出该大小,MySQL产生一个 The table tbl_name is full 形式的错误,
- 如果你做很多高级 GROUP BY 查询,增加 tmp_table_size 值。
- 这是 mysql 官方关于此选项的解释:
- tmp_table_size
- This variable determines the maximum size for a temporary table in memory.
- If the table becomes too large, a MYISAM table is created on disk.
- Try to avoid temporary tables by optimizing the queries where possible, but where this is not possible, try to ensure temporary tables are always stored in memory.
- Watching the processlist for queries with temporary tables that take too long to resolve can give you an early warning that tmp_table_size needs to be upped.
- Be aware that memory is also allocated per-thread.
- An example where upping this worked for more was a server where I upped this from 32MB (the default) to 64MB with immediate effect.
- The quicker resolution of queries resulted in less threads being active at any one time, with all-round benefits for the server, and available memory.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30150152/viewspace-1781854/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30150152/viewspace-1781854/