Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
839 connectés 

  FORUM HardWare.fr
  Linux et OS Alternatifs

  Quel filesystem pour un ramdisk ?

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Quel filesystem pour un ramdisk ?

n°728106
Bool
Posté le 11-09-2005 à 13:09:17  profilanswer
 

Hello les gens ;)
 
Je dois monter un petit ramdisk de quelques 512Mo pour le stockage de fichiers de session de PHP, pour un site à fort trafic (on est pas pret de remplir ces 512Mo, mais vu qu'il faut rebooter la machine pour redimensionner le ramdisk je préfère prévoir trop grand que pas assez).
 
Donc, sur ce ramdisk il n'y aura vraissemblablement que des petits fichiers, mais en grand nombre (vraissemblablement, plusieurs milliers...).
 
Quel système de fichier me conseillez vous ? Bon, je me doute qu'un FS journalisé ne servira à rien... Mais j'aimerais être sûr qu'il n'y ait pas quelque chose de plus adapté que "ext2". (si je pouvais éviter d'avoir à répartir les fichiers dans plusieurs dossiers, ça me simplifierait la tache).
 
merci :D
 

mood
Publicité
Posté le 11-09-2005 à 13:09:17  profilanswer
 

n°728107
Mjules
Modérateur
Parle dans le vide
Posté le 11-09-2005 à 13:11:14  profilanswer
 

pourquoi ne pas utiliser tmpfs ? si je ne m'abuse, c'est plus évolué qu'un ramdisk en ce sens que la taille du dossier monté dessus peut changer.

Citation :


Tmpfs is a file system which keeps all files in virtual memory.
 
 
Everything in tmpfs is temporary in the sense that no files will be
created on your hard drive. If you unmount a tmpfs instance,
everything stored therein is lost.
 
tmpfs puts everything into the kernel internal caches and grows and
shrinks to accommodate the files it contains and is able to swap
unneeded pages out to swap space. It has maximum size limits which can
be adjusted on the fly via 'mount -o remount ...'
 
If you compare it to ramfs (which was the template to create tmpfs)
you gain swapping and limit checking. Another similar thing is the RAM
disk (/dev/ram*), which simulates a fixed size hard disk in physical
RAM, where you have to create an ordinary filesystem on top. Ramdisks
cannot swap and you do not have the possibility to resize them.  
 
Since tmpfs lives completely in the page cache and on swap, all tmpfs
pages currently in memory will show up as cached. It will not show up
as shared or something like that. Further on you can check the actual
RAM+swap use of a tmpfs instance with df(1) and du(1).
 
 
tmpfs has the following uses:
 
1) There is always a kernel internal mount which you will not see at
   all. This is used for shared anonymous mappings and SYSV shared
   memory.  
 
   This mount does not depend on CONFIG_TMPFS. If CONFIG_TMPFS is not
   set, the user visible part of tmpfs is not build. But the internal
   mechanisms are always present.
 
2) glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
   POSIX shared memory (shm_open, shm_unlink). Adding the following
   line to /etc/fstab should take care of this:
 
        tmpfs   /dev/shm        tmpfs   defaults        0 0
 
   Remember to create the directory that you intend to mount tmpfs on
   if necessary (/dev/shm is automagically created if you use devfs).
 
   This mount is _not_ needed for SYSV shared memory. The internal
   mount is used for that. (In the 2.3 kernel versions it was
   necessary to mount the predecessor of tmpfs (shm fs) to use SYSV
   shared memory)
3) Some people (including me) find it very convenient to mount it
   e.g. on /tmp and /var/tmp and have a big swap partition. And now
   loop mounts of tmpfs files do work, so mkinitrd shipped by most
   distributions should succeed with a tmpfs /tmp.
 
4) And probably a lot more I do not know about :-)
 
 
tmpfs has three mount options for sizing:
 
size:      The limit of allocated bytes for this tmpfs instance. The  
           default is half of your physical RAM without swap. If you
           oversize your tmpfs instances the machine will deadlock
           since the OOM handler will not be able to free that memory.
nr_blocks: The same as size, but in blocks of PAGE_CACHE_SIZE.
nr_inodes: The maximum number of inodes for this instance. The default
           is half of the number of your physical RAM pages.
 
These parameters accept a suffix k, m or g for kilo, mega and giga and
can be changed on remount.  The size parameter also accepts a suffix %
to limit this tmpfs instance to that percentage of your physical RAM:
the default, when neither size nor nr_blocks is specified, is size=50%
 
 
To specify the initial root directory you can use the following mount
options:
 
mode:   The permissions as an octal number
uid:    The user id  
gid:    The group id
 
These options do not have any effect on remount. You can change these
parameters with chmod(1), chown(1) and chgrp(1) on a mounted filesystem.
 
 
So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
will give you tmpfs instance on /mytmpfs which can allocate 10GB
RAM/SWAP in 10240 inodes and it is only accessible by root.
 
 
Author:
   Christoph Rohland <cr@sap.com>, 1.12.01
Updated:
   Hugh Dickins <hugh@veritas.com>, 01 April 2003


 
extrait de la doc du noyau ( /usr/src/linux/Documentation/filesystems/tmpfs.txt )


Message édité par Mjules le 11-09-2005 à 13:18:09

---------------
Celui qui pose une question est idiot 5 minutes. Celui qui n'en pose pas le reste toute sa vie. |  Membre du grand complot pharmaceutico-médico-scientifico-judéo-maçonnique.
n°728118
Bool
Posté le 11-09-2005 à 13:21:03  profilanswer
 

ah bah voilà une réponse qu'elle est bonne :D
 
merci :P

n°728150
0x90
Posté le 11-09-2005 à 14:11:16  profilanswer
 

Je confirme, tmpfs ca marche trèèès bieng ;)


---------------
Me: Django Localization, Yogo Puzzle, Chrome Grapher, C++ Signals, Brainf*ck.

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Linux et OS Alternatifs

  Quel filesystem pour un ramdisk ?

 

Sujets relatifs
Suse m'a détruit mon filesystem[Bench] Meilleur filesystem / elevator pour MySQL
utiliser un RamDisk[SiD] "filesystem superblock is corrupt"
Probleme dd : Filesystem not cleanly unmountede2fsck et filesystem.
Renommage d'un filesystem sous SOLARIS9 - Problème réglé[ Quotas et ACL ] Quel FileSystem choisir ? ext3, xfs, ReiserFS....
[filesystem] comment marche la cache d un filesystem??quel est le filesystem le plus rapide avec du raid 5 et du LVM
Plus de sujets relatifs à : Quel filesystem pour un ramdisk ?


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR