LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-19-2007, 08:17 PM   #1
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Rep: Reputation: 15
Meaning of SHMALL kernel variable


Hi Folks,

I'm trying to set up a DB server so it has plenty of RAM (for Postgresql 8.2). The Postgres instructions suggest modifying the values for these kernel variables:

SHMMAX
SHMALL

OK. No problem, I can do that (I know where to set them dynamically and at boot time).

The examples and explanation are as follows:

Quote:
For example, to allow 128 MB, and explicitly set the maximum total shared memory size to 2097152 pages (the default):

$ sysctl -w kernel.shmmax=134217728
$ sysctl -w kernel.shmall=2097152
OK. I get SHMMAX (maximum total shared memory--I actually want more like 384MB).

Someone please tell me what kernel.shmall=2097152 pages means. What does page mean in this context and how does this relate to SHMMAX?

(Frankly, I don't want to set this value to the default, I want it to be big--the server has lots of RAM and I want to use it.)

Thanks for any insight you can give me.

John
 
Old 12-19-2007, 08:25 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
There's some info on Werner Puschitz's Oracle site at http://www.puschitz.com/TuningLinuxF...ngSharedMemory that might help:
Code:
Setting SHMALL Parameter

This parameter sets the total amount of shared memory pages that can 
be used system wide. Hence, SHMALL should always be at least 
ceil(shmmax/PAGE_SIZE).

The default size for SHMALL in RHEL 3/4 and 2.1 is 2097152 which is also 
Oracle's recommended minimum setting for 9i and 10g on x86 and x86-64 
platforms. In most cases this setting should be sufficient since it means 
that the total amount of shared memory available on the system is 
2097152*4096 bytes (shmall*PAGE_SIZE) which is 8 GB. PAGE_SIZE is usually 
4096 bytes unless you use Big Pages or Huge Pages which supports the 
configuration of larger memory pages.
 
Old 12-20-2007, 08:35 AM   #3
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Original Poster
Rep: Reputation: 15
Yes, and page size is?

Thanks for the info. Most helpful to see it so clearly laid out. Is PAGE_SIZE a characteristic of the Linux install, the file system, or what?
 
Old 12-20-2007, 11:54 AM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
It's memory pages they're referring to in this case. I don't know much about the nuts and bolts of it, but there's some info about optimising memory usage at http://www.puschitz.com/TuningLinuxF...ryOptimization
 
Old 12-20-2007, 03:16 PM   #5
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Original Poster
Rep: Reputation: 15
I found one reference that said that w/ 32-bit Linux, you're dealing with a 4K page. So, I tried that number ( SHMMAX / 4096 ) and that seemed to work.
 
Old 04-28-2010, 06:07 PM   #6
alpapan
LQ Newbie
 
Registered: Apr 2010
Posts: 1

Rep: Reputation: 0
in case someone else is looking

getconf PAGE_SIZE
 
  


Reply

Tags
definition


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
defining global variable in fedora kernel tuncausluer Linux - Software 0 12-31-2004 01:53 PM
Issues with Large SHMALL value s_damarla Linux - General 2 10-29-2004 02:43 PM
Question: meaning of Hz in the Linux Kernel Arc4ne Linux - General 8 08-15-2004 10:12 PM
Question about external variable in kernel. ryanux Programming 0 08-02-2004 01:11 AM
Kernel options meaning ??? td0l2 Linux - Newbie 13 07-11-2004 08:57 AM


All times are GMT -5. The time now is 11:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration