Hi Micah-- Thanks for adjusting the default vserver device tree to include /dev/shm!
On Sat 2008-11-08 14:07:20 -0500, Micah Anderson wrote:
> I think its probably best to leave it as a regular directory, rather
> than a tmpfs. The reason is because we already are providing a very
> minimal /tmp as a tmpfs, and this eats into the available memory on the
> entire box (this of course can be increased as needed, but it occupies
> memory space), adding a second tmpfs that must get mounted at /dev/shm
> will further complicate this resource problem. I think that the best way
> to handle it is to leave it as a directory, and let the admin decide if
> they want to remount it as a tmpfs for optimization purposes and based
> on their particular host's memory availability.
It was my impression that a tmpfs only consumes RAM when there is data
in it; for example, you can allocate a very large tmpfs with no
increase in memory consumption:
[0 [EMAIL PROTECTED] ~]# grep mnt /proc/mounts
[1 [EMAIL PROTECTED] ~]# free
total used free shared buffers cached
Mem: 1027444 904428 123016 0 59724 497056
-/+ buffers/cache: 347648 679796
Swap: 1572856 968 1571888
[0 [EMAIL PROTECTED] ~]# mount -t tmpfs tmpfs /mnt -osize=400G
[0 [EMAIL PROTECTED] ~]# grep mnt /proc/mounts
tmpfs /mnt tmpfs rw,size=419430400k 0 0
[0 [EMAIL PROTECTED] ~]# free
total used free shared buffers cached
Mem: 1027444 904320 123124 0 59736 497056
-/+ buffers/cache: 347528 679916
Swap: 1572856 968 1571888
[0 [EMAIL PROTECTED] ~]# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
tmpfs 400G 0 400G 0% /mnt
[0 [EMAIL PROTECTED] ~]# umount /mnt
[0 [EMAIL PROTECTED] ~]#
And surely there are other ways that a guest vserver can also consume
RAM aside from a tmpfs, like a memory-hungry process!
Is it that the RAM in a tmpfs is by definition outside of the vserver
framework's ability to limit RAM consumption? If so, why is /tmp set
up that way at all, when it does not need to be? Why not default to
no tmpfs mounts? To my mind, there is a better argument for /dev/shm
to be a tmpfs than there is for /tmp, since it is required for POSIX
shared memory compatibility, but i am probably missing the bigger
picture.
I'm not sure i understand the rationale behind the decision of when to
ship a tmpfs by default and when not to. Can you explain?
--dkg
pgpwsyKuUXQe4.pgp
Description: PGP signature

