- UID
- 816
- 阅读权限
- 100
- 帖子
- 4970
- 精华贴数
- 3
- 技术排名
- 193
- 技术积分
- 9951
- 社区排名
- 3700
- 社区积分
- 199
- 注册时间
- 2001-10-9
- 精华贴数
- 3
- 技术积分
- 9951
- 社区积分
- 199
- 注册时间
- 2001-10-9
- 论坛徽章:
- 29
|
发表于 2006-5-20 12:16:53
|显示全部楼层
Re: 关于Linux 下kernel.shmmax 。
最初由 tolywang 发布
[B]
如果物理内存是 2 G, 假设这台DB Server上还有Apache 在运行,那么shmmax 中设置的内存也会被Apache 来使用,那么分配的 2 块共享内存段给Oracle 是否就是 2 * 1G , 还是仅仅满足 SGA需求的 1.2 G就停止分配 , 其他的内存的一部分分配给Oracle PGA 和软件 Apache 来使用 ?
[/B]
shmmax is just a number only used in comparison when the shared memory segment is created. When the segment is created by a process, OS checks to see if the requested segment size is larger than shmmax. If yes, it throws an error. [see example code at end for a test] Oracle must be doing something more intelligent, such as trying to create the segment again by splitting the requested size into two chunks.
"shmmax 中设置的内存也会被Apache 来使用" is conceptually wrong. Each process has its own shared memory segment (if it creates it). Unless process A attaches to B's existing segment, process A simply won't have shared memory.
I remember Oracle's installation guide for 32-bit Solaris recommends setting shmmax to the 32-bit number limit, i.e. 4GB. Back then, 4GB RAM Solaris machines were not popular and the recommendation worked fine.
[example for a quick test]
#!/usr/bin/perl -w
use IPC::SysV qw(IPC_PRIVATE IPC_RMID S_IRWXU);
$size = 33554433;
$id = shmget(IPC_PRIVATE, $size, S_IRWXU) || die "$!";
shmctl($id, IPC_RMID, 0) || die "$!";
My /proc/sys/kernel/shmmax says 33554432. This is RH Linux.
Yong Huang |
|