Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ramdisk Creation not initrd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
njcwotx
Guru
Guru


Joined: 25 Feb 2005
Posts: 564
Location: Texas

PostPosted: Thu Nov 04, 2010 5:39 pm    Post subject: Ramdisk Creation not initrd Reply with quote

I need to do some testing in Vmware ESX. I have a gentoo vm to test with. Trying to play with effects of large memory usage vm's and what it does to the host, vm, and neighbor vm's.

I added 12G of memory and made sure kernel would address it, free and proc reports 12G, but the vm just wont use the free space, even during compiling etc. VMware wont even appear to grant more than 3G, which is a little puzzling.

So, Thought If I added a ram disk and filled it up with stuff, it would get me the usaage I needed and see what would happen.

I just want to confirm this is the correct way.

#> mkdir /mnt/ramdisk
#> mount -t tmpfs none /mnt/ramdisk -o size=6000m (creates a 6G filesystem in ram)

at that point, I should be able to write files to /mnt/ramdisk and fill up the memory and write and read the files. Correct?


Also, if I created 2 tmpfs filesystems, how does that work if I dont specify size?
_________________
Drinking from the fountain of knowldege.
Sometimes sipping.
Sometimes gulping.
Always thirsting.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5877

PostPosted: Thu Nov 04, 2010 5:57 pm    Post subject: Reply with quote

tmpfs defaults to 50% of the available RAM.
Back to top
View user's profile Send private message
njcwotx
Guru
Guru


Joined: 25 Feb 2005
Posts: 564
Location: Texas

PostPosted: Thu Nov 04, 2010 6:07 pm    Post subject: Reply with quote

what if you have multiple tmpfs?

is this correct?

Assuming 10G "Free"

first tmpfs gets 5G
second tmpfs gets 2.5G
third tmpfs gets 1.25G
fourth tmpfs gets .625G
fifth tmpfs gets .3125G
etc.
_________________
Drinking from the fountain of knowldege.
Sometimes sipping.
Sometimes gulping.
Always thirsting.
Back to top
View user's profile Send private message
s0be
Apprentice
Apprentice


Joined: 23 Nov 2002
Posts: 239

PostPosted: Thu Nov 04, 2010 6:54 pm    Post subject: Reply with quote

njcwotx wrote:
what if you have multiple tmpfs?

is this correct?

Assuming 10G "Free"

first tmpfs gets 5G
second tmpfs gets 2.5G
third tmpfs gets 1.25G
fourth tmpfs gets .625G
fifth tmpfs gets .3125G
etc.


Assuming you have 20GB ram,

all tmpfs will combine for one 10GB backing store, then all the mounts share that. If mount 1 uses 9gb, the rest get to split the remaining 1gb. There is no 'per tmpfs' amount, unless you explicitly define it like this:

Code:

tmpfs  /var/www/cache   tmpfs   size=20M


in fstab or in the -o options for mount. I'm not sure if that allocates an additional 20M, or just limits it to 20M total though.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5877

PostPosted: Fri Nov 05, 2010 12:01 am    Post subject: Reply with quote

Code:
# free -m
             total       used       free     shared    buffers     cached
Mem:          5971       3932       2039          0        436       2559
-/+ buffers/cache:        936       5035
Swap:          956          0        956

# for i in {1..20}; do mkdir $i; mount -t tmpfs tmpfs $i; done

# df | grep mnt
tmpfs                  3057572         0   3057572   0% /mnt/1
tmpfs                  3057572         0   3057572   0% /mnt/2
tmpfs                  3057572         0   3057572   0% /mnt/3
tmpfs                  3057572         0   3057572   0% /mnt/4
tmpfs                  3057572         0   3057572   0% /mnt/5
tmpfs                  3057572         0   3057572   0% /mnt/6
tmpfs                  3057572         0   3057572   0% /mnt/7
tmpfs                  3057572         0   3057572   0% /mnt/8
tmpfs                  3057572         0   3057572   0% /mnt/9
tmpfs                  3057572         0   3057572   0% /mnt/10
tmpfs                  3057572         0   3057572   0% /mnt/11
tmpfs                  3057572         0   3057572   0% /mnt/12
tmpfs                  3057572         0   3057572   0% /mnt/13
tmpfs                  3057572         0   3057572   0% /mnt/14
tmpfs                  3057572         0   3057572   0% /mnt/15
tmpfs                  3057572         0   3057572   0% /mnt/16
tmpfs                  3057572         0   3057572   0% /mnt/17
tmpfs                  3057572         0   3057572   0% /mnt/18
tmpfs                  3057572         0   3057572   0% /mnt/19
tmpfs                  3057572         0   3057572   0% /mnt/20
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum