LinuxQuestions.org
Review your favorite Linux distribution.
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-18-2008, 01:28 AM   #1
shreyasw
LQ Newbie
 
Registered: Sep 2008
Posts: 7

Rep: Reputation: 0
Question what is the difference between tmpfs and ramdisk in linux?


what is the difference between tmpfs and ramdisk? if they differ which one is benificial in terms time required to access?

I have a file (size >500MB).which i want to put in the memory to reduce access time and avoid diskio. i tried using ramdisk which improved access time to some extend.
I just wanted to know whether tmpfs gives better performance than ramdisk.

Also if anyone have idea to do this in any other way in linux please help me out. ( I want to access this file from kernel module so i can not use mmap)

Thanks in advance

shreyas
 
Old 12-18-2008, 03:50 AM   #2
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 307

Rep: Reputation: 38
TempFS is a memory based file holder which will only allow you to use half of whatever physical memory is available. If you have to store just short of 1GB of data, you'll need 2GB of physical ram available. It'll have instant access as it sits on memory. It's also dynamically changeable size wise.

Ramdisks however is a file with a file system inside of it loaded in to memory. It's difficult to dynamically change it's size and it's fast for reading but not writing to.

If you have to use one, TempFS is the way to go, or Sata 10k RPM raptor HDD would probably suffice
 
Old 12-19-2008, 12:19 AM   #3
shreyasw
LQ Newbie
 
Registered: Sep 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Smile

Thanks a lot for that information. just out of curiosity, i did not get exactly what "memory based file holder" is? can u suggest any link or doc to understand implementation difference?

Thanks,
Shreyas.
 
Old 12-19-2008, 09:45 AM   #4
Kenhelm
Member
 
Registered: Mar 2008
Location: N. W. England
Distribution: Mandriva
Posts: 333

Rep: Reputation: 141Reputation: 141
There is an explanation of tmpfs at
http://www.funtoo.org/en/articles/linux/ffg/3/
 
Old 12-22-2008, 04:41 AM   #5
shreyasw
LQ Newbie
 
Registered: Sep 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Question

I am facing one problem while using tmpfs.

my program creates a file of around 3MB. and then i access it later multiple times.

now when i created file on normal (/ partition) partition it took around 1 minute to create that file.

then i thought of using tmpfs to speed up creation and access to this file.

So I created same file on tmpfs partition, it took 3 minutes ( 3 times more than normal partition). which is something i never expected.

also access time is more by couple of seconds.

now the confusion is when i use tmpfs my results must improve which is not happening.

I mounted tmpfs using following command

mount tmpfs /mnt/tmpfs -t tmpfs

Can somebody tell me what is going wrong?

Thanks in advance

Shreyas
 
Old 12-22-2008, 06:45 AM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,758
Blog Entries: 27

Rep: Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079
Hi,
Quote:
Originally Posted by arckane View Post
<snip>

Ramdisks however is a file with a file system inside of it loaded in to memory. It's difficult to dynamically change it's size and it's fast for reading but not writing to.

If you have to use one, TempFS is the way to go, or Sata 10k RPM raptor HDD would probably suffice

Would you clarify your statement for;

Quote:
It's difficult to dynamically change it's size and it's fast for reading but not writing to
What is this based on?


As for the 10K hdd subsystem speed, it would not compare to a 'ramdisk' nor a 'ssd' subsystem. Sure a 10K would work faster than a 5400 or 7200 but they too would not compare to a 'ramdisk' or a 'ssd'.
 
  


Reply


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
RAMDISK: couldn't find valid ramdisk image starting at 0. iotc247 Slackware 10 12-10-2010 03:08 PM
Creating Linux Ramdisk smd453 Linux - Kernel 4 02-18-2007 10:39 AM
GC-RAMDISK not seen by Linux hank_o_bot Linux - Hardware 10 04-10-2006 12:56 AM
creating a ramdisk runtime from another ramdisk code123 Linux From Scratch 0 10-11-2004 08:59 AM
Option of tmpfs Instead of RAMdisk when Creating Bootdisk fbagnato Linux - Newbie 2 03-27-2002 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:01 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration