免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8294 | 回复: 7

open_files_limit加大不了,只到65535 [复制链接]

论坛徽章:
0
发表于 2010-08-20 22:27 |显示全部楼层
本帖最后由 justin033 于 2010-08-20 23:04 编辑

背景:我们这边大量的分库分表,总共354个库,表总共7W多个,3分1是MyISAM表。

系统版本:CentOS release 5.4 (Final) MySQL 版本5.1.39
  1. [root@~]# find /data02/mysql/ -name "*.frm" | wc -l
  2. 70468
复制代码
sysctl.conf和limit.conf的配置,如下:
  1. # Add By Justin
  2. vm.swappiness = 10

  3. fs.file-max = 204800
复制代码
  1. # Add By Justin
  2. *               soft     nofile         204800
  3. *               hard     nofile         204800
复制代码
  1. [root@~]# ulimit -a
  2. core file size          (blocks, -c) 0
  3. data seg size           (kbytes, -d) unlimited
  4. scheduling priority             (-e) 0
  5. file size               (blocks, -f) unlimited
  6. pending signals                 (-i) 81920
  7. max locked memory       (kbytes, -l) 32
  8. max memory size         (kbytes, -m) unlimited
  9. open files                      (-n) 204800
  10. pipe size            (512 bytes, -p) 8
  11. POSIX message queues     (bytes, -q) 819200
  12. real-time priority              (-r) 0
  13. stack size              (kbytes, -s) 10240
  14. cpu time               (seconds, -t) unlimited
  15. max user processes              (-u) 81920
  16. virtual memory          (kbytes, -v) unlimited
  17. file locks                      (-x) unlimited
  18. [root@~]# cat /proc/sys/fs/file-nr
  19. 4590    0       204800
复制代码
用户MySQL的环境设置:
  1. [root@~]# su - mysql
  2. [mysql@~]$ whoami
  3. mysql
  4. [mysql@~]$ ulimit -a
  5. core file size          (blocks, -c) 0
  6. data seg size           (kbytes, -d) unlimited
  7. scheduling priority             (-e) 0
  8. file size               (blocks, -f) unlimited
  9. pending signals                 (-i) 81920
  10. max locked memory       (kbytes, -l) 32
  11. max memory size         (kbytes, -m) unlimited
  12. open files                      (-n) 204800
  13. pipe size            (512 bytes, -p) 8
  14. POSIX message queues     (bytes, -q) 819200
  15. real-time priority              (-r) 0
  16. stack size              (kbytes, -s) 10240
  17. cpu time               (seconds, -t) unlimited
  18. max user processes              (-u) 81920
  19. virtual memory          (kbytes, -v) unlimited
  20. file locks                      (-x) unlimited
复制代码

但是
:mysql里open_files_limit只到65535,没达到我设置的值,如下:
  1. "Variable_name","Value"
  2. "open_files_limit","65535"
复制代码
主机也重启了,mysql的open_files_limit的值还没超过65535。。。有人遇到过没。。。。。。。。。。。。。。。。。。。。。。。。

论坛徽章:
0
发表于 2010-08-20 23:02 |显示全部楼层
回复 1# justin033


    peisai,补充下mysql error log的记录:
  1. 100820 18:31:30 mysqld_safe mysqld from pid file /data02/mysql/db102.greenemls.org.pid ended
  2. 100820 18:32:50 mysqld_safe Starting mysqld daemon with databases from /data02/mysql
  3. 100820 18:32:50 [Warning] Could not increase number of max_open_files to more than 65535 (request: 102561)
  4. 100820 18:32:50 [Note] Plugin 'FEDERATED' is disabled.
  5. 100820 18:32:50 [Note] Plugin 'ndbcluster' is disabled.
  6. InnoDB: The InnoDB memory heap is disabled
  7. InnoDB: Mutexes and rw_locks use GCC atomic builtins.
  8. 100820 18:32:50  InnoDB: highest supported file format is Barracuda.
  9. 100820 18:32:51 InnoDB Plugin 1.0.4-7 started; log sequence number 7203394656
  10. 100820 18:32:51 [Note] Event Scheduler: Loaded 0 events
  11. 100820 18:32:51 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
  12. Version: '5.1.39-Community-log'  socket: '/data02/mysql/mysql.sock'  port: 3306  5.1.39 Source
  13. 100820 18:32:51 [Note] Event Scheduler: scheduler thread started with id 1
  14. 100820 18:33:30 [Note] /usr/local/mysql/libexec/mysqld: Normal shutdown

  15. 100820 18:33:30 [Note] Event Scheduler: Killing the scheduler thread, thread id 1
  16. 100820 18:33:30 [Note] Event Scheduler: Waiting for the scheduler thread to reply
  17. 100820 18:33:30 [Note] Event Scheduler: Stopped
  18. 100820 18:33:30 [Note] Event Scheduler: Purging the queue. 0 events
  19. 100820 18:33:30  InnoDB: Starting shutdown...
  20. 100820 18:33:32  InnoDB: Shutdown completed; log sequence number 7203394666
  21. 100820 18:33:32 [Warning] Forcing shutdown of 2 plugins
  22. 100820 18:33:32 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete

  23. 100820 18:33:32 mysqld_safe mysqld from pid file /data02/mysql/db102.greenemls.org.pid ended
  24. 100820 18:37:15 mysqld_safe Starting mysqld daemon with databases from /data02/mysql
  25. 100820 18:37:16 [Warning] Could not increase number of max_open_files to more than 65535 (request: 102561)
  26. 100820 18:37:16 [Note] Plugin 'FEDERATED' is disabled.
  27. 100820 18:37:16 [Note] Plugin 'ndbcluster' is disabled.
  28. InnoDB: The InnoDB memory heap is disabled
  29. InnoDB: Mutexes and rw_locks use GCC atomic builtins.
  30. 100820 18:37:17  InnoDB: highest supported file format is Barracuda.
  31. 100820 18:37:20 InnoDB Plugin 1.0.4-7 started; log sequence number 7203394666
  32. 100820 18:37:21 [Note] Event Scheduler: Loaded 0 events
  33. 100820 18:37:21 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
  34. Version: '5.1.39-Community-log'  socket: '/data02/mysql/mysql.sock'  port: 3306  5.1.39 Source
  35. 100820 18:37:21 [Note] Event Scheduler: scheduler thread started with id 1
  36. 100820 18:37:52 mysqld_safe A mysqld process already exists
  37. [root@db102 ~]#
复制代码

论坛徽章:
0
发表于 2010-08-20 23:10 |显示全部楼层
设置成0好了
设置成0即不更改系统中的配置数
open_files_limit

Command-Line Format --open-files-limit=#
Config-File Format open-files-limit
Option Sets Variable Yes, open_files_limit
Variable Name open_files_limit
Variable Scope Global
Dynamic Variable No
  Permitted Values  
Type numeric
Default 0
Range 0-65535

The number of files that the operating system permits mysqld to open. This is the real value permitted by the system and might be different from the value you gave using the --open-files-limit option to mysqld or mysqld_safe. The value is 0 on systems where MySQL can't change the number of open files.

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
发表于 2010-08-20 23:13 |显示全部楼层
好像挺多现在都是65535这个数字。

论坛徽章:
0
发表于 2010-08-20 23:19 |显示全部楼层
看来是我错了,:wink:,认真看了文档的open_files_limit说明,最大只能65535。。。。。。杯具了,难道要改源代码

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
发表于 2010-08-21 09:37 |显示全部楼层
看来是我错了,,认真看了文档的open_files_limit说明,最大只能65535。。。。。。杯具了,难道要改源 ...
justin033 发表于 2010-08-20 23:19



    估计得改源代码,还要注意是否影响其他的,避免crash

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
发表于 2010-08-23 09:19 |显示全部楼层
http://bugs.mysql.com/bug.php?id=47095
他的意思是,如果设置为0,那么就会使用ulimit -n 的值,也就不会有65535的限制。popgo可以试下~

论坛徽章:
0
发表于 2010-09-09 16:28 |显示全部楼层
设置open_files_limit=0,mysqld起不来,而且error log不报错
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP