Operating System - HP-UX
1748069 Members
5219 Online
108758 Solutions
New Discussion юеВ

Re: How to restrict System Memory for a particular user

 
Md. Minhaz Khan
Super Advisor

How to restrict System Memory for a particular user

Dear Experts,

I want to restrict memory usage of "oracle" user
to consume memory up to 10 GB. If oracle user request memory more than 10GB then he will fail.
For this reason i use ulimit in the $HOME/.profile of oracle

$cat .profile
.....
.....

ulimit -m 10485760

..............
...........

Is the above setting is right ?? Please advise.

Thanks
Minhaz
9 REPLIES 9
Md. Minhaz Khan
Super Advisor

Re: How to restrict System Memory for a particular user

In my system a single user process can go upto
1 GB (maxdsiz) & 2 GB (maxdsiz_64). My query is not for a single process memory consumption. Actually i want to restrict globally oracle user to consume memory not more than 10 GB.

Thanks
Minhaz
Steven E. Protter
Exalted Contributor

Re: How to restrict System Memory for a particular user

Shalom Minhaz,

ulimit is the way to go. However you are making limits on a single process, not an aggregate consumption for the user.

The kernel parameters mentioned above can help, but again apply to a single process, not an aggregate total for a user.

PRM, an add in product can let you control resources a user users overall.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Emil Velez
Honored Contributor

Re: How to restrict System Memory for a particular user

You can do it with PRM by creating a group with that userid and assigning it a maximum percentage of memory.

Md. Minhaz Khan
Super Advisor

Re: How to restrict System Memory for a particular user

Dear Emil/Steven,

We have used HP-UX 11.23 EOE. PRM is already installed. Can you give me steps on how can i assigned 50% memory to user "oracle" . At present my system has 16 GB memory.

Thanks
Minhaz
Dennis Handly
Acclaimed Contributor

Re: How to restrict System Memory for a particular user

>SEP: ulimit is the way to go.

Unfortunately it is limited to 32 bit, unless you have a 64 bit shell.
Md. Minhaz Khan
Super Advisor

Re: How to restrict System Memory for a particular user

We have used HP-UX 11.23 EOE. PRM is already installed. Can anyone give me steps on how can i assigned 50% memory to user "oracle" using PRM (HP process resource manager). At present my system has 16 GB memory.


Thanks
Minhaz
Earl_Crowder
Trusted Contributor

Re: How to restrict System Memory for a particular user

Minhaz,

Setting up PRM requires a bit of planning. A good whitepaper on PRM and memory : http://h20338.www2.hp.com/hpux11i/downloads/5983-1676EN.pdf

PRM documentation is available under HPUX core documentation:
http://www.hp.com/go/hpux-core-docs -> Select 11iv2, PRM documentation is under "User Guides".

Earl
Bill Hassell
Honored Contributor

Re: How to restrict System Memory for a particular user

ulimit will limit local memory for programs run by the oracle user. But normally these processes are quite small compared to the amount of RAM used by shared memory (SGA in Oracle terms). ulimit has no effect on shared memory usage

Also, ulimit is per-process, so there may be 10 processes that each use 1GB. But the total of all the processes is 10GB. There is no parameter to limit all the processes for a particular user. That's where PRM will be of use. But remember that memory usage by oracle is largely controlled by the data base administrator. And when Oracle processes hit a memory limit, the database programs will stop or crash. Rather than cripple the programs, it would make more sense to configure the Oracle parameters to reduce memory usage. Also note that in general, reducing memory for database programs means slower performance.


Bill Hassell, sysadmin
Hein van den Heuvel
Honored Contributor

Re: How to restrict System Memory for a particular user

Minhaz,

Be sure to carefully review Bill's and SEP's replies. Even if it is not entirely clear, heed their advice don't hide it.

What version of Oracle?

>> Can you give me steps on how can i assigned 50% memory to user "oracle" . At present my system has 16 GB memory.

Why? My guess is that you are following up a general suggestion to give 1/2 memory to Oracle. That's fine if Oracle is the dominant application on the system. But if it is the only application on the system, then why not give it 100% outside the kernel memory and some buffer cache?

You are trying to approach this problem from the outside in (the OS), trying to draw a limit line. But how can the OS tell Oracle to use MORE if the 50% is not reached?

Try looking at the problem from the inside out to solve both dilemmas.
The oracle user is typically used to create a number of database instances ( just 1 for dedicated production boxes). Each instances has a bunch of processes that take some memory to run, but mostly the work memory is defined by SHARED (SGA) and PRIVATE (PGA) memory setting and the DBA can and should request based on negotiation with the SA (you?) as to how much is available in total (that 50%, or 90% !?)
Google for PGA_TARGET and SGA_TARGET, and read some of those and you'll get the drift.
For example, but not only: http://www.orafaq.com/wiki/Sga_target

I am convinced that armed with that new found knowledge you will be able nor only to control 'oracle' to use less than 10GB, but also to allow/make it use more than 8GB as you + DB find appropriate.
And it will be 'soft' control not a hard stop (ORA-600).

Good luck!
Hein
HvdH Performance Consulting