Solaris 上的 Oracle DB 在可用 RAM 时利用交换内存
我们有一个奇怪的实例,我们注意到我们的 Oracle 数据库服务器交换利用率为 100%,并且惊讶地发现系统在此期间有可用的可用内存。据我所知,一旦系统耗尽可用内存,交换内存就会开始使用(如果我错了,请纠正我)。不确定是什么导致了这种异常活动。还有其他人经历过这种行为吗?
法规,
We have a weird instance where we noticed our oracle database server swap utilization was 100% and surprised to see that the system had free memory available during that period. To my knowledge, swap memory utilization starts once system runs out of free RAM (please correct me if i'm wrong). Not sure what could have caused this unusual activity. Had anyone else experienced such behaviour?
Regs,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用的是 Solaris 10 或更高版本,则系统参数不再位于 /etc/system 中。相反,您可以通过区域、任务或用户级别的“项目”配置动态管理资源。
例如,这是我们区域之一中的这些项目配置文件之一。
这里的设置意味着用户名 oracle 的用户将受益于特定的资源设置。
要设置将这样的行添加到项目文件中,请使用
projadd
命令。要修改它,请使用projmod
命令,如果您想列出 Oracle 当前可用的所有资源,您可以type:
prctl -i project user.oracle
这将列出该“项目”可用的所有资源。
If you are using solaris 10 or later, system parameters are not in /etc/system anymore. Instead, you configure dynamically managed resources through "projects" at the zone, task or user level.
Here is for instance one of these project config files in one of our zones.
The settings here mean that a user of username oracle will benefit of a specific resource setting.
To set add such a line to the project file you use the
projadd
command. To modify it theprojmod
command and if you want to list all the resources currently available to oracle you wouldtype:
prctl -i project user.oracle
This will list all resources available to that 'project'.
您应该提供有关如何获取指标的详细信息,但交换和 RAM 利用率之间没有直接关系。您当然可以在空闲 RAM 仍然可用的情况下退出交换空间。
必须有足够的交换空间来容纳所有(虚拟)内存预留。内存预留(即 malloc)不使用 RAM。仅在访问虚拟内存时才需要 RAM。
You should provide details on how you get your metrics but there is no direct relationship between swap and RAM utilization. You certainly can get out of swap space with free RAM still available.
There must be enough swap for all (virtual) memory reservations to fit. Memory reservation (i.e. malloc) use no RAM. RAM is only required during virtual memory access.
在 Solaris 上运行的 Oracle DB 有一个“bug”。
它是操作系统上的“保留”交换,其中“交换”和“RAM”组合成一个虚拟内存池。
保留交换只会无缘无故地耗尽基于磁盘的交换区域,根本不应该这样做。
RAM 和交换区之间的所有转换均由 Solaris 操作系统本身处理。
我花了近 5 年的时间才让 Sun/Oracle 理解了 Java 的完全相同的问题。
最新的 Java 7 和 8 不再“双重浸入”内存池。
我发现,如果操作系统遇到“交换”限制,则相应地调整内存大小,并完全删除交换。
在可用零交换的情况下,所有内存交互都在物理内存中,您不会看到双浸问题,并且只要您有足够的内存来运行所有内容,您就不会看到有关交换耗尽的错误。
Oracle DB running on Solaris has a "bug".
It is "reserving" swap on an Operating system where "swap" and "ram" are combined into one virtual memory pool.
Reserving swap just exhausts the disk based swap area for no reason and should not be doing this at all.
All transitioning between ram and swap is handled by the Solaris OS itself.
It took me almost 5 years to get Sun/Oracle to understand the exact same problem with Java.
Latest Java 7 and 8 no longer "double dip" into the memory pool.
What I've found, in cases where the OS runs into a "Swap" limit is to size the memory accordingly, and remove swap altogether.
With zero swap available, all memory interactions are in physical ram and you won't see the double dip issue, and you won't see errors about swap exhaustion as long as you have sufficient ram for everything to run.