Koozali.org: home of the SME Server

/dev/shm is this virtual drive memory

Offline purvis

  • ****
  • 567
  • +0/-0
/dev/shm is this virtual drive memory
« on: April 22, 2013, 11:49:27 PM »
I would like to speed up a program accessing a database.
Is the directory /dev/shm memory storage in SME 8
What is /dev/shm  and tmpfs.
Can I use this space?
Thanks in advance for answers.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: /dev/shm is this virtual drive memory
« Reply #1 on: April 24, 2013, 06:54:18 PM »
I would like to speed up a program accessing a database.
Is the directory /dev/shm memory storage in SME 8

http://lmgtfy.com/?q=%2Fdev%2Fshm

Quote
What is /dev/shm  and tmpfs.
Can I use this space?
Thanks in advance for answers.

Google has some very good answers for you.

Offline purvis

  • ****
  • 567
  • +0/-0
Re: /dev/shm is this virtual drive memory
« Reply #2 on: April 25, 2013, 08:10:47 AM »
Charlie I did some reading previous to posting the question.
Seems i did not find a total standardization on the use of  /tmpfs and /tmp on all systems.
I try to keep things standard as can be.
After transferring some files to /dev/shm and doing some speed test. I would of expected those files in /dev/shm to be much faster that being placed in regular directory.

Maybe linux is swapping those files in memory(whatever  files where placed in /dev/shm) to disk.
I guess i need to put more memory in the computer. I understand the linux makes use of all available memory.

I will accept it not being harmful to use /dev/shm as virtual memory.

I also found this using this code helpful to set the /dev/shm virtual memory

If you don't have loads(lots/a super large amount) of memory in your system.
Don't use the line having 1G in it.

Code: [Select]
mount -o remount,size=1G /dev/shm                 #create(expand/shrink)  virtual memory to 1 gig
mount -o remount,size=100M /dev/shm            #create(expand/shrink)  virtual memory to 100 MB
« Last Edit: April 26, 2013, 03:11:30 AM by purvis »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: /dev/shm is this virtual drive memory
« Reply #3 on: April 25, 2013, 04:09:47 PM »
Charlie I did some reading previous to posting the question.

We don't have a crystal ball, and your question didn't reveal any prior research.

Quote
After transferring some files to /dev/shm and doing some speed test. I would of expected those files in /dev/shm to be much faster that being placed in regular directory.

Maybe linux is swapping those files in memory(whatever  files where placed in /dev/shm) to disk.

Linux always uses memory for disk caching.  It's called the buffer cache.

Whatever performance problem you are trying to deal with can probably be better addressed some other way than you trying to change tmpfs or /dev/shm settings.

Quote
I try to keep things standard as can be.

Good. Don't change /etc/fstab. You might break something, and it's unlikely to solve your problem.