1828933 Members
2240 Online
109986 Solutions
New Discussion

Re: /dev/shm - RHAS 3.0

 
SOLVED
Go to solution
Jorge Cocomess
Super Advisor

/dev/shm - RHAS 3.0

Does anyone know what's /dev/shm and what is used for? Is this something like upper memory that you can pin a process so it can run faster?

Thanks,
J


Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p7 755920 395196 322324 56% /
/dev/cciss/c0d0p1 122622 4802 117820 4% /boot/efi
/dev/cciss/c0d0p6 1511856 639688 795368 45% /home
none 24974608 0 24974608 0% /dev/shm
/dev/cciss/c0d0p5 2015824 50928 1862496 3% /tmp
23 REPLIES 23
Stuart Browne
Honored Contributor

Re: /dev/shm - RHAS 3.0

No, it's a non-fs shared memory segment used for IPC.
One long-haired git at your service...
Ivan Ferreira
Honored Contributor
Solution

Re: /dev/shm - RHAS 3.0

The /dev/shm stands for shared memory. It can be used to tweak the shared memory parameters for applications like Oracle.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jorge Cocomess
Super Advisor

Re: /dev/shm - RHAS 3.0

Hi Ivan - Can you tell me more about the parameters or point me to where I can read up on this paramters. Yes, I intend to use on the my Oracle 10g box.

Thanks much!!

J
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

See this link:

http://www.oracle-base.com/articles/linux/LargeSGAOnLinux.php

Please assign points to the people that helps you.

Have a nice day.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jorge Cocomess
Super Advisor

Re: /dev/shm - RHAS 3.0

Gentlemen -
Would you know what's the command to show your current SGA parameter?

Again, many thanks!!

J
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

That information you should get it through oracle, I don't know about oracle, but normally I use:

ipcs -a

You will see tha shared memory regiongs, the owner and the size.

To identify the size of the shared memory used currently.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jorge Cocomess
Super Advisor

Re: /dev/shm - RHAS 3.0

Great, Ivan. By the way, how do you read this? Many thanks!!

J.

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 0 gdm 600 393216 2 dest
0x00000000 1146881 oracle 640 1343488 15
0x00000000 1179650 oracle 640 125829120 15
0xe3f40ad4 1212419 oracle 640 16384 15
0x00000000 1245188 oracle 640 1343488 43
0x00000000 1277957 oracle 640 4294967296 43
0x3a16bd24 1310726 oracle 640 16384 43
0x00000000 1409032 oracle 640 1359872 62
0x00000000 1441801 oracle 640 1048576 62
0x00000000 1474570 oracle 640 6442450944 62
0x00000000 1507339 oracle 640 3204448256 62
0x16c7cd84 1540108 oracle 640 32768 62

------ Semaphore Arrays --------
key semid owner perms nsems
0x15018304 2457600 oracle 640 34
0xfb949950 2588673 oracle 640 202
0xfb949951 2621442 oracle 640 202
0xfb949952 2654211 oracle 640 202
0x79ca2f70 2818053 oracle 640 154

------ Message Queues --------
key msqid owner perms used-bytes messages
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

In shared memory segments, sum all the "bytes" columns to get the total. The output looks very bad so i don't sum it.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

From that output, if you sum all shared memory segments used by oracle, looks that you have 7040 MB (7GB), and that your shm-max (maximum size of shared memory) is 640 MB.

To change the value SHMMAX, you can use either of the following three methods:

# This method sets the SHMMAX on startup by inserting the following kernel parameter in the /etc/sysctl.conf startup file:

# echo "kernel.shmmax=2147483648" >> /etc/sysctl.conf

# If you wanted to dynamically alter the value of SHMMAX without rebooting the machine, you can make this change directly to the /proc file system. This command can be made permanent by putting it into the /etc/rc.local startup file:

# echo "2147483648" > /proc/sys/kernel/shmmax

# You can also use the sysctl command to change the value of SHMMAX:

# sysctl -w kernel.shmmax=2147483648
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jorge Cocomess
Super Advisor

Re: /dev/shm - RHAS 3.0

Ivan - When you say the sum is "bad", do you mean our configuration is bad or just the layout was bad?

Do you think I need to modify my SHMMAX?

Thanks,
J
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

I just said that the format is bad and difficult to read in your message. It's not bad, but the oracle recommendation is to use the values that I posted before.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Mike Stroyan
Honored Contributor

Re: /dev/shm - RHAS 3.0

Ivan, you aren't reading that correctly.
The system already has 14GB of oracle shared memory. The largest single shared memory object is 6GB in size. Jorge shouldn't reduce the maximum shared memory segment size to 2GB.
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

My apologizes, Mike is right. I was reading the permissions instead of the bytes. Sorry for the confusion.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

I feel stupid, how a shared memory will be 640 bytes? I don't know what I was thinking. The sum of all bytes gives 14072856576 (14 GB), and you can see:

0x00000000 1474570 oracle 640 6442450944 62

Tha means that the largest size of a segment is 6 GB. From here:

http://www.puschitz.com/TuningLinuxForOracle.shtml#SettingSharedMemory

You can read:

"This means that SHMMAX should not exceed 4294967295 on a 32-bit system. On x86-64 platforms, SHMMAX can be much larger than 4GB since the virtual address space is not limited by 32 bits."

Can you post the ouput of:

# cat /proc/sys/kernel/shmmax

To be sure about how you have it configured?

Once again I'm sorry, I don't like to commit this kind of mistakes.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jorge Cocomess
Super Advisor

Re: /dev/shm - RHAS 3.0

No problem on my part, since I'm still in the learning mode. Here's the result.

6442450944


Thanks,
J
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

Acording to the link above you should reduce the size to 4294967296.

I participated of various installations, and normally, we always use that size at maximum, or 2 GB because if the SGA is larger, it will just use more segments.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Mike Stroyan
Honored Contributor

Re: /dev/shm - RHAS 3.0

This must be a 64-bit system to have an existing 6GB shared memory segment. The limit on shared memory segment size does not need to be below 4GB.

The huge pages feature has a lot of potential for performance improvement on a large memory system like this. It is covered in the same document that Ivan linked to.
http://www.puschitz.com/TuningLinuxForOracle.shtml#LargeMemoryOptimization
Jorge Cocomess
Super Advisor

Re: /dev/shm - RHAS 3.0

Hi,

Yes, this is a 64-bits server with 49GB of memory. I'm not sure if the Oracle 10g is in need of tuning. However, I think the MSA1500 cs SANs can use some help though. I wish we went with a smaller EVA SAN instead of these MSA's.

Do you guys still think I need to tune my Oracle server? Please help!

Thanks,
J
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

It's difficult to say if you need to tune your system, you must do a system performance analysis, if the performance is good, you don't need to tune the system.

I would recommend this redbook.

http://www.redbooks.ibm.com/abstracts/redp3861.html?Open

This has good information about how to identify problems. And a good section about oracle.

Also, this gives some recommedations about tuning the disk subsystem and the elevator.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

And just one more information, even when there states that 64 bit computing can use large shared memory, we use Alpha Servers with Tru64 Unix (64 bit), and the oracle installation guide recommends the use of a maximum shared memory of 4 GB - 16 MB, that is:

4278190080

Cheers!
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jorge Cocomess
Super Advisor

Re: /dev/shm - RHAS 3.0

This is great info for tuning and such!! You guys are too good!!

Would you know if there's a way to fine tune a raw partition within Linux servers? Due to Oracle RAC, we're using raw partitions and quite a bit of them mounted on two nodes. I would like to know if there way to optimize raw partition within Linux environment?

Again, thanks.
J
Ivan Ferreira
Honored Contributor

Re: /dev/shm - RHAS 3.0

I don't think that you can tune raw devices and maybe you should consider the use of OCFS:

http://www.oracle.com/technology/oramag/webcolumns/2002/techarticles/scalzo_linux02.html

"However, if the operating system supports an Oracle-certified cluster file system, the cluster file system can be used instead."

More info:

http://www.oracle.com/technology/pub/articles/calish_filesys2.html
http://www.oracle.com/technology/pub/columns/talkinglinux_0104.html
http://www.oracle.com/technology/pub/notes/technote_singh_crs.html
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:7931107631402
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jorge Cocomess
Super Advisor

Re: /dev/shm - RHAS 3.0

I am sorry...That's what I meant. We use OCFS for the Oracle RAC.

Thanks,
J