12
返回列表 发新帖
楼主: tolywang

[笔记] 关于Linux 下kernel.shmmax 。

[复制链接]
论坛徽章:
113
ITPUB9周年纪念徽章
日期:2010-10-08 09:28:512011新春纪念徽章
日期:2011-02-18 11:42:50现任管理团队成员
日期:2011-05-07 01:45:08ITPUB官方微博粉丝徽章
日期:2011-06-28 19:45:36蛋疼蛋
日期:2011-07-24 22:25:332012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:25
11#
发表于 2009-11-5 21:34 | 只看该作者
mark下。

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
20
祖国60周年纪念徽章
日期:2009-10-09 08:28:00数据库板块每日发贴之星
日期:2011-02-20 01:01:01ITPUB季度 技术新星
日期:2011-04-02 10:31:09ITPUB十周年纪念徽章
日期:2011-11-01 16:24:042012新春纪念徽章
日期:2012-01-04 11:54:26玉石琵琶
日期:2012-02-21 15:04:38最佳人气徽章
日期:2012-03-13 17:39:18ITPUB 11周年纪念徽章
日期:2012-10-09 18:09:192013年新春福章
日期:2013-02-25 14:51:242011新春纪念徽章
日期:2011-02-18 11:43:33
12#
发表于 2009-11-15 20:14 | 只看该作者
我汗  还是得出个具体的结论来

使用道具 举报

回复
论坛徽章:
1
2010新春纪念徽章
日期:2010-01-04 08:33:08
13#
发表于 2009-11-16 11:44 | 只看该作者

  1. [root@rac01 ~]# cat /etc/sysctl.conf | grep kernel.shmmax
  2. kernel.shmmax = 20971520
  3. [root@rac01 ~]# ipcs -sa

  4. ------ Shared Memory Segments --------
  5. key        shmid      owner      perms      bytes      nattch     status                           
  6. 0x00000000 65537      oracle    640        4194304    27                     
  7. 0x00000000 98306      oracle    640        20971520   27                     
  8. 0x00000000 131075     oracle    640        20971520   27                     
  9. 0x00000000 163844     oracle    640        20971520   27                     
  10. 0x00000000 196613     oracle    640        20971520   27                     
  11. 0x00000000 229382     oracle    640        20971520   27                     
  12. 0x00000000 262151     oracle    640        20971520   27                     
  13. 0x00000000 294920     oracle    640        20971520   27                     
  14. 0xd2776b04 327689     oracle    640        20971520   27                     

  15. ------ Semaphore Arrays --------
  16. key        semid      owner      perms      nsems            
  17. 0xfafd7074 360449     oracle    640        104      

  18. ------ Message Queues --------
  19. key        msqid      owner      perms      used-bytes   messages
  20.    
  21. 因为kernel.shmmax设置过小,导致分配了多个共享内存段
  22. 下边改大一些:
  23. [root@rac01 ~]# cat /etc/sysctl.conf | grep kernel.shmmax
  24. kernel.shmmax = 2147483648
  25. [root@rac01 ~]# sysctl -p
  26. [root@rac01 ~]# su - oracle
  27. [oracle@rac01 ~]$ export ORACLE_SID=myrac1
  28. [oracle@rac01 ~]$ sqlplus '/as sysdba'

  29. SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 16 05:50:00 2009

  30. Copyright (c) 1982, 2005, Oracle.  All rights reserved.


  31. Connected to:
  32. Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
  33. With the Partitioning, Real Application Clusters, Oracle Label Security, OLAP
  34. and Data Mining Scoring Engine options

  35. SQL> startup force
  36. ORACLE instance started.

  37. Total System Global Area  167772160 bytes
  38. Fixed Size                  1218316 bytes
  39. Variable Size             104859892 bytes
  40. Database Buffers           58720256 bytes
  41. Redo Buffers                2973696 bytes
  42. Database mounted.
  43. Database opened.
  44. SQL> quit
  45. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
  46. With the Partitioning, Real Application Clusters, Oracle Label Security, OLAP
  47. and Data Mining Scoring Engine options
  48. [oracle@rac01 ~]$ exit
  49. logout
  50. 再看一下:
  51. [root@rac01 ~]# ipcs -sa

  52. ------ Shared Memory Segments --------
  53. key        shmid      owner      perms      bytes      nattch     status                           
  54. 0xd2776b04 360449     oracle    640        171966464  27                     

  55. ------ Semaphore Arrays --------
  56. key        semid      owner      perms      nsems            
  57. 0xfafd7074 491521     oracle    640        104      

  58. ------ Message Queues --------
  59. key        msqid      owner      perms      used-bytes   messages
  60. 只有一个内存段分配了
复制代码

对于性能的影响,其实就跟磁盘的碎片一个道理,碎片越多,性能越低,但是普通的操作看不出差别,经常整理碎片的人应该更能理解这个问题吧!
另外上边的
0x00000000 65537      oracle    640        4194304    27                     
0x00000000 98306      oracle    640        20971520   27                     
也能回答楼主的对于1.2G是否会分配2G的问题了,1.2G还是1.2G,只不过一个没分那么大而已.

使用道具 举报

回复
论坛徽章:
1
2010新春纪念徽章
日期:2010-01-04 08:33:08
14#
发表于 2009-11-16 12:02 | 只看该作者
汗!3年前的帖子,忘看时间就回复了......

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
15#
发表于 2009-11-17 03:23 | 只看该作者
原帖由 jinxino_o 于 2009-11-15 21:44 发表
对于性能的影响,其实就跟磁盘的碎片一个道理,碎片越多,性能越低,但是普通的操作看不出差别,经常整理碎片的人应该更能理解这个问题吧!


The impact of too many fragments for a shared memory segment on performance is not nearly as big a problem as that of tablespace fragmentation. According to Steve Adams (see his little O'Reilly book), when you have multiple shared memory segment fragments, starting up the instance and creating a new server process will be slightly slower. There's no other negative effect.

Yong Huang

使用道具 举报

回复
论坛徽章:
1
2010新春纪念徽章
日期:2010-01-04 08:33:08
16#
发表于 2009-11-17 09:19 | 只看该作者

回复 #15 Yong Huang 的帖子

看到版主的回复,相比而言,更想多跟版主学学英语!

使用道具 举报

回复
论坛徽章:
4
ITPUB8周年纪念徽章
日期:2009-09-27 10:21:21ITPUB学员
日期:2010-01-05 18:19:20ITPUB9周年纪念徽章
日期:2010-10-08 09:32:26ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26
17#
发表于 2009-11-30 15:46 | 只看该作者
我挖呀!   木乃伊快出来了

使用道具 举报

回复
论坛徽章:
314
行业板块每日发贴之星
日期:2012-07-12 18:47:29双黄蛋
日期:2011-08-12 17:31:04咸鸭蛋
日期:2011-08-18 15:13:51迷宫蛋
日期:2011-08-18 16:58:25紫蛋头
日期:2011-08-31 10:57:28ITPUB十周年纪念徽章
日期:2011-09-27 16:30:47蜘蛛蛋
日期:2011-10-20 15:51:25迷宫蛋
日期:2011-10-29 11:12:59ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41鲜花蛋
日期:2011-11-09 20:33:30
18#
发表于 2014-11-25 11:25 | 只看该作者
Yong Huang 发表于 2009-11-17 03:23
The impact of too many fragments for a shared memory segment on performance is not nearly as big ...

版主,有无测试数据证明你的说法?

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
19#
发表于 2014-11-25 23:38 | 只看该作者
ZALBB 发表于 2014-11-24 21:25
版主,有无测试数据证明你的说法?

No. I've never tested it. Theoretically, there should be difference in time because each shmget() call takes time, but the difference may be too small to measure.

使用道具 举报

回复
论坛徽章:
314
行业板块每日发贴之星
日期:2012-07-12 18:47:29双黄蛋
日期:2011-08-12 17:31:04咸鸭蛋
日期:2011-08-18 15:13:51迷宫蛋
日期:2011-08-18 16:58:25紫蛋头
日期:2011-08-31 10:57:28ITPUB十周年纪念徽章
日期:2011-09-27 16:30:47蜘蛛蛋
日期:2011-10-20 15:51:25迷宫蛋
日期:2011-10-29 11:12:59ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41鲜花蛋
日期:2011-11-09 20:33:30
20#
发表于 2014-11-26 08:41 | 只看该作者
Yong Huang 发表于 2014-11-25 23:38
No. I've never tested it. Theoretically, there should be difference in time because each shmget()  ...

明白,谢谢。

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表