Memory restrictions in Solaris 10 zones

From: Moore, Joe (jmoore@ugs.com)
Date: Fri Sep 02 2005 - 13:41:20 EDT


This seems like something that must have been solved before, but I can't
find any references to it.

What we have:
        A server with 4GB of physical memory running Solaris 10

What we need:
        Two oracle servers

Simple, right: just create two zones, install Oracle, and we're up and
running, right? Well...

Out of the box, Oracle uses a lot of shared memory. It creates an "SGA"
(shared global area) which consists of a fixed memory size (relatively
small) and a variable part that it computes based on the amount of
available memory. In our case, it decided that the total size of the
SGA should be about 3GB.

Unfortunately, the second Oracle instance (in the second zone)
independantly came to the same conclusion, so there is now 6GB of memory
in active use on a server with 4GB of ram.

We've found rcapd(1M), which claims to limit projects to a certain
amount of resident physical memory, but there are 2 problems with it:
First, rcapd counts shared memory wrong: if there are 2 processes
sharing a 1GB segment, rcapd interprets this a 2GB of used physical
memory. So it's trying to swap out the other 140GB of each Oracle's
RSS. Second, rcapd enforces these limits based on projects, which are
defined in terms of userids. Since the userid (oraadm) is only defined
in the non-global zones (and is the same on the two zones anyway), we'd
have to define the limits in the non-global /etc/project[0], and rely on
the DBAs to "play fair" and not modify their limits[1].

We've also found that we can limit the total memory size via
/etc/project using the resource_controls(5) project.max-shm-memory, but
that just makes Oracle fail to startup when it tries to allocate more
memory than that limit. (In addition to relying on the DBAs to play
fair and not up their limits)

We've also found the Oracle parameter "sga_max_size" (set in the Oracle
init files), but that relies on the DBAs again...

Does anyone know of a way to get two (or more) Oracle environments to
happily coexist (in separate zones) on one physical server?
Or how to make a subzone report that it only has 2GB of memory available
to it (which would change Oracle's calculation)?
Or any other way to approach this?

--Joe
[0] Yes, we could implement an LDAP directory to keep /etc/project, but
that's a larger headache ATM.
[1] Not that we don't trust them, but they're sharing the system with
other uses, and may not realize the impact of doubling their memory
usage, which kicks the web application's Java stack out to swap, which
causes the web team to get annoyed at us, which ruins everyone's day.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:31:30 EDT