ディスクとメモリーへの書き込み速度確認
ddコマンドで128Mのブロックサイズを2回書き込んだ速度確認

ディスク: real 0m7.087s
メモリー: real 0m0.788s
約9倍の書き込み速度の違いが見られる。

ファイルシステムへの書き込み速度

[root@HOME001 local]# df -h
Filesystem            Size  Used Avail Use% マウント位置
/dev/mapper/vg_home001-lv_root
                       47G  2.5G   42G   6% /
tmpfs                 947M     0  947M   0% /dev/shm
/dev/sda1             485M   36M  424M   8% /boot
/dev/mapper/vg_home001-lv_home
                      4.6G  322M  4.0G   8% /home
[root@HOME001 local]# time dd if=/dev/zero of=/usr/local/tmp/tmpfs bs=128M count=2
2+0 records in
2+0 records out
268435456 bytes (268 MB) copied, 7.06478 s, 38.0 MB/s

real    0m7.087s
user    0m0.001s
sys     0m0.949s
[root@HOME001 local]# rm -f /usr/local/tmp/*

[root@HOME001 local]# free
             total       used       free     shared    buffers     cached
Mem:       1938948     200436    1738512          0      10720      94452
-/+ buffers/cache:      95264    1843684
Swap:      4161528          0    4161528
[root@HOME001 local]#

tmpfs(メモリー)への書き込み速度

[root@HOME001 local]# mount -t tmpfs -o size=512m tmpfs /usr/local/tmp
[root@HOME001 local]# df -h
Filesystem            Size  Used Avail Use% マウント位置
/dev/mapper/vg_home001-lv_root
                       47G  2.5G   42G   6% /
tmpfs                 947M     0  947M   0% /dev/shm
/dev/sda1             485M   36M  424M   8% /boot
/dev/mapper/vg_home001-lv_home
                      4.6G  322M  4.0G   8% /home
tmpfs                 512M     0  512M   0% /usr/local/tmp
[root@HOME001 local]# time dd if=/dev/zero of=/usr/local/tmp/tmpfs bs=128M count=2
2+0 records in
2+0 records out
268435456 bytes (268 MB) copied, 0.770854 s, 348 MB/s

real    0m0.788s
user    0m0.000s
sys     0m0.784s
[root@HOME001 local]#

[root@HOME001 local]# df -h
Filesystem            Size  Used Avail Use% マウント位置
/dev/mapper/vg_home001-lv_root
                       47G  2.5G   42G   6% /
tmpfs                 947M     0  947M   0% /dev/shm
/dev/sda1             485M   36M  424M   8% /boot
/dev/mapper/vg_home001-lv_home
                      4.6G  322M  4.0G   8% /home
tmpfs                 512M  257M  256M  51% /usr/local/tmp
[root@HOME001 local]# free
             total       used       free     shared    buffers     cached
Mem:       1938948     462820    1476128          0      10720     356596
-/+ buffers/cache:      95504    1843444
Swap:      4161528          0    4161528
[root@HOME001 local]#

tempfs

fstabに追記して常時起動

[root@HOME001 local]# df -h
Filesystem            Size  Used Avail Use% マウント位置
/dev/mapper/vg_home001-lv_root     47G  2.5G   42G   6% /
tmpfs                             947M     0  947M   0% /dev/shm
/dev/sda1                         485M   36M  424M   8% /boot
/dev/mapper/vg_home001-lv_home    4.6G  322M  4.0G   8% /home
[root@HOME001 local]# vi /etc/fstab

[root@HOME001 local]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Nov 25 06:08:34 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_home001-lv_root /                       ext4    defaults        1 1
UUID=d0a823c7-d51e-42de-b422-2f3ab5d82d96 /boot                   ext4    defaults        1 2
/dev/mapper/vg_home001-lv_home /home                   ext4    defaults        1 2
/dev/mapper/vg_home001-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
# add for memory disk
tmpfs                   /usr/local/tmp          tmpfs   defaults,size=512m 0 0
[root@HOME001 local]#


[root@HOME001 local]# mount -a
[root@HOME001 local]# df -h
Filesystem            Size  Used Avail Use% マウント位置
/dev/mapper/vg_home001-lv_root     47G  2.5G   42G   6% /
tmpfs                             947M     0  947M   0% /dev/shm
/dev/sda1                         485M   36M  424M   8% /boot
/dev/mapper/vg_home001-lv_home    4.6G  322M  4.0G   8% /home
tmpfs                             128M     0  512M   0% /usr/local/tmp
[root@HOME001 local]#


[root@HOME001 local]# time dd if=/dev/zero of=/usr/local/tmp/tmpfs bs=128M count=2
2+0 records in
2+0 records out
268435456 bytes (268 MB) copied, 0.776067 s, 346 MB/s

real    0m0.793s
user    0m0.001s
sys     0m0.789s
[root@HOME001 local]#

再起動後もマウントされている事を確認済み

fstab

関連スレ
MYSQL with tempfs

Comments are closed.

Post Navigation