MySQL为了适应大规模bi拉取数据的参数调整

线上bi实例,专门用于bi拉数或开发定位问题用的,需要调整以下参数

SET GLOBAL wait_timeout = 28800;       -- 28800秒(8小时)
SET GLOBAL interactive_timeout = 28800;
SET GLOBAL net_read_timeout = 600;    -- 增大到10分钟,适合大查询
SET GLOBAL net_write_timeout = 600;
SET GLOBAL max_execution_time = 0;    -- 设置为0,表示不限制查询时间
SET GLOBAL sort_buffer_size = 167772160;    -- 160M
SET GLOBAL read_buffer_size = 16777216;   
SET GLOBAL innodb_lock_wait_timeout = 300; 
SET GLOBAL max_allowed_packet = 1073741824;  

-脚本

mysqlw -h  mysql6303-w.corp.dboop.com -P 6303 -e "SET GLOBAL interactive_timeout = 28800;SET GLOBAL wait_timeout = 28800; SET GLOBAL net_write_timeout = 600;SET GLOBAL net_read_timeout = 600;SET GLOBAL innodb_lock_wait_timeout = 300; SET GLOBAL max_allowed_packet = 1073741824;  SET GLOBAL read_buffer_size = 16777216;   SET GLOBAL sort_buffer_size = 167772160;  SET GLOBAL max_execution_time = 0;"
>> Home

51ak

2024/10/12

Categories: mysql Tags: 基础

《数据库工作笔记》公众号
扫描上面的二维码,关注我的《数据库工作笔记》公众号