Irrelevant thoughts of an oracle DBA

11 November 2007

linux / unix kernel parameters

Filed under: Uncategorized — dhoogfr @ 16:05

I have a confession to make: the linux/unix kernel parameters have always been somewhat of a mistery to me and while I have installed several databases on linux and solaris systems I never realy understood how to tune them. I just followed the oracle installation documentation and metalink note 169706.1.

But recently I had to perform an installation on a 64bit linux system. The database in question was going to be used to develop a data warehouse system and the company asked to have at least a buffer cache of 4 GB. Now the box had 16 GB of ram so this requirement should not pose any problem.
So I started preparing the os for the installation and looked to metalink for the recommended kernel values. At that point I noticed that the value for the shmmax parameter on linux 64bit was stated as “max(ram in bytes, 4GB) / 2″ “max(ram in bytes/2, 4 GB * 1024^3)”. This limit of 4 GB seems a little bit strange to me for a 64bit system, so I posted a service request on this and started a quest for more information on the kernel parameters.

I found an excellent explanation here, but after reading it I started to ask myself more questions on the values recommended by Oracle in the installation guide and on metalink.
As I understand it, the shmmax parameter is supposed to be the maximum size of a single shared memory segments (and the oracle sga is build out of these shared memory segments). The shmmni parameter gives the maximum number of shared memory segments system wide and shmall gives the total amount of shared memory (expressed in pages).
If I combine the 3 definitions I understand that the maximum shared memory will be the minimum between shmmax * shmmni and shmall * page_size.

When I calculate the parameters with the values specified in metalink note 169706.1 (for my system with 16 GB ram) I get the following results:

shmmax = min(4294967296, RAM in bytes) /2 = min(4294967296, 17179869184)/2 = 4294967296/2 = 2147483648
shmmax = min(RAM in bytes / 2 , 4294967296) = min (17179869184 / 2, 4294967296) = 4294967296
shmmni = 4096
shmall = shmmax / page_size = 2147483648 / 4096 = 524288
shmall = shmmax / page_size = 4294967296 / 4096 = 1048576

Which would mean that on my system I get a maximum of 2 GB 4 GB of shared memory, and thus a maximum sga of 2GB 4 GB (actually less, because this limit is system wide and not only for my oracle instance). Needless to say that when you are needing a 64bit system, this 2 GB 4 GB limit is a little bit on the low side…

In metalink note 169706.1 there is, next to the shmall parameter, a link to another note (301830.1) which states to set the shmall parameter to “ram size / page_size” instead of shmmax / page_size. For my system with 16 GB of ram, this would give a shmall of 4194304 instead of 524288 and thus indeed fixing my problem.
Also if you would compare the proposed values in the installation guide with those from metalink you will notice that the shmall in the installation guide (2097152) is much higher then on metalink (allowing for 8 GB of shared memory when your pagesize is 4096) and that there is no 4GB limitation in the calculation of the shmmax parameter.

During my searh Oracle also responded on my SR on metalink, saying that the 4 GB limit in the shmmax calculation is not an os limit but an oracle limit. They also said that this was because 4GB is the maximum size of a core dump. Now what the size of the core dump has to do with the size of a shared memory segment is yet unclear to me, and it also makes me wonder if my calculation of shmmax is correct. (After having received some feedback by oracle it indeed turned out that my formulla for shmmax was not correct, so I have made the necessary adjustments in the post)
I will keep searching for this and update the post when I have more information.

shmmax and solaris 10

A couple of days later, I needed to install oracle on a solaris 10 system. Now with solaris 10 the way to specify kernel parameters differs from the prior solaris versions. You now no longer need to put your kernel parameters in the /etc/system file, but instead use projects and projmod.
Because of past experiences on solaris 10 I already knew that the oracle installation guide was not very correct on how to work with projects (and because of my newly gained understanding of the kernel parameters) I started to search for more information on solaris 10 kernel parameters.

I soon found out that the parameter project.max-shm-memory which is replacing the old shmmax parameter differs not only in name and how to set it (note that using prctl to set the kernel parameter, as suggested in the installation guide will make the parameter not persistant), but also in definition!
When you look at the solaris tunable parameters reference manual you will note that the parameter is not specifying the maximum size of a single shared memory segment, but instead the maximum shared memory for your entire project. In the installation guide, however, oracle is still using the same value for the new project.max-shm-memory parameter as with the old shmmax parameter. So when you follow the recommended values for the installation guide you would suddenly limit the total sga size for all databases on your system to 4GB (unless you use different users with different projects for your databases).

So be warned: when it comes to kernel parameters, don’t just take the values specified in the installation guide.

About these ads


  1. I have made some corrections in the past after receicing some more feedback from oracle.
    As it turned out, I misinterpreted the formulla for shmmax on metalink.
    It should be “max(ram in bytes/2, 4 GB * 1024^3)” and not “max(ram in bytes, 4GB * 1024^3) / 2″.
    If you use this formulla in your calculations you would get a maximum of 4 GB shared memory instead of 2 GB.

    Still waiting on feedback about the core dump limitation.

    Comment by dhoogfr — 13 November 2007 @ 12:00 | Reply

  2. [...] Filed under: infrastructure — dhoogfr @ 21:21 This is a follow-up note on my prior linux / unix kernel parameters [...]

    Pingback by linux / unix kernel parameters follow-up « Irrelevant thoughts of an oracle DBA — 27 November 2007 @ 21:21 | Reply

  3. Nice article

    Comment by everton r — 14 July 2008 @ 22:50 | Reply

  4. Nice post… Wondering if you have got the answer for 4Gb core dump limitation?

    Comment by Sudh — 5 November 2008 @ 16:22 | Reply

    • Hi,

      No, but then again I have not spend much time on this, as I needed to work on other things.
      It should not be to hard to test it I think. Just setup a system with a SGA of more then 4GB and initiate a core dump (I think there was a method posted on the oracle-L list on how to force a core dump). Unfortionatly I’m lacking the hardware to test it and I doubt I get permission to do it on one of my client’s systems :)

      Comment by dhoogfr — 7 December 2008 @ 14:13 | Reply

  5. This is a good info that project.max-shm-memory is maximum shared memory for the user’s (say oracle) entire project instead of a segment’s maximum shared memory.

    Comment by karthik — 24 December 2008 @ 22:22 | Reply

  6. Do уou hav a spam isѕue on this site; I also am a blοgger, and I was wondering your situation; mwny of
    us have developed some nice procedurеs and we are looking to trade
    strategies with others, be sure to shoot me an e-mail if interested.

    Comment by — 14 December 2013 @ 11:29 | Reply

  7. Fantastic post but I was wanting to know if you could write
    a litte more on this topic? I’d be very grateful if you could elaborate a little bit further.
    Many thanks!

    Comment by Www.Britblog.Com — 8 February 2014 @ 15:49 | Reply

  8. hi!,I love your writing so a lot! percentage we communicate more about your article on
    AOL? I require an expert on this area to resolve my problem.
    Maybe that’s you! Having a look forward to look you.

    Comment by Tinisha Balazs — 17 February 2014 @ 9:50 | Reply

  9. This piece of writing is really a nice one it assists new web users,
    who are wishing for blogging.

    Comment by campagne adwords — 4 March 2014 @ 9:50 | Reply

  10. It’s a pity you don’t have a donate button! I’d without a doubt donate to
    this fantastic blog! I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account.
    I look forward to new updates and will share this blog with my Facebook group.
    Chat soon!

    Comment by boat charter samui — 6 March 2014 @ 5:17 | Reply

  11. Release of this excess flow is necessary to prevent flooding
    in homes, basements, businesses, and streets but it adds bacteria and
    contaminants as potential threats to tap water. Waste
    Water Treatment: Generally the sole objective
    of an advanced waste water treatment is to ensure that the waste water and other industrial effluents
    are released into the environment whereby they ensure minimum or no harm.

    These plants are widely used for separating suspended solids from river and lake water.

    Comment by Milagro — 14 March 2014 @ 0:26 | Reply

  12. This post is actually a pleasant one it helps new net users, who are wishing in favor of blogging.

    Comment by vacation home — 23 March 2014 @ 12:58 | Reply

  13. Thanks , I have recently been looking for info approximately this subject for ages and yours is the best I’ve came upon till now.

    However, what about the bottom line? Are you certain concerning the

    Comment by Kimbra Pangle — 1 April 2014 @ 13:11 | Reply

  14. Greetings from Ohio! I’m bored at work so I decided to browse
    your site on my iphone during lunch break.
    I love the information you present here and can’t wait to take a look when I
    get home. I’m shocked at how quick your blog loaded on my cell phone ..
    I’m not even using WIFI, just 3G .. Anyhow, amazing site!

    Comment by Stacia — 6 April 2014 @ 21:40 | Reply

  15. It’s hard to describe the experience with the Chromebook Pixel.
    t a regular issue and is also almost certainly due to the sensitivity setting on the
    pad. However you are feeling relating to this new middle ground, Google has produced a robust push to own the space from the traditional laptop
    and a tablet.

    Comment by Kerrie — 21 April 2014 @ 0:24 | Reply

  16. 3G or 3 grams technology identifies phones which
    may have an access to international internet connections.
    For other uses, permission in writing from Successercising@msn. Everything loaded faster, queued faster and was just better about the Roku
    3 than the predecessor models in my opinion and during my testing.

    Comment by lg smart tv apps download — 31 May 2014 @ 6:10 | Reply

  17. Description: Gory MMOFPS with a heavy focus on building custom weapons.
    The Amazon website just recently had a 15 percent discount on several of their Kindle
    Fire tablets as a special sale for the recent FAA lifting of
    restrictions about passengers using their devices during take-off or landing on flights.
    Samsung packs its new smartphones with either a dual-core 1.

    Comment by Latasha — 29 June 2014 @ 15:04 | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Create a free website or blog at


Get every new post delivered to your Inbox.

%d bloggers like this: