Re: How to restrict System Memory for a particular user (364 Views)
Reply
Super Advisor
Md. Minhaz Khan
Posts: 272
Registered: ‎12-24-2008
Message 1 of 10 (364 Views)

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
Please use plain text.
Super Advisor
Md. Minhaz Khan
Posts: 272
Registered: ‎12-24-2008
Message 2 of 10 (364 Views)

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
Please use plain text.
Exalted Contributor
Steven E. Protter
Posts: 33,806
Registered: ‎08-15-2002
Message 3 of 10 (364 Views)

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
Please use plain text.
Honored Contributor
Emil Velez
Posts: 1,450
Registered: ‎05-17-2000
Message 4 of 10 (364 Views)

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.

Please use plain text.
Super Advisor
Md. Minhaz Khan
Posts: 272
Registered: ‎12-24-2008
Message 5 of 10 (364 Views)

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
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,894
Registered: ‎03-06-2006
Message 6 of 10 (364 Views)

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.
Please use plain text.
Super Advisor
Md. Minhaz Khan
Posts: 272
Registered: ‎12-24-2008
Message 7 of 10 (364 Views)

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
Please use plain text.
Trusted Contributor
Earl_Crowder
Posts: 76
Registered: ‎07-17-2001
Message 8 of 10 (364 Views)

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
Please use plain text.
Honored Contributor
Bill Hassell
Posts: 14,200
Registered: ‎05-29-2000
Message 9 of 10 (364 Views)

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.
Please use plain text.
Honored Contributor
Hein van den Heuvel
Posts: 6,585
Registered: ‎05-19-2003
Message 10 of 10 (364 Views)

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

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation