سوال یکی از دوستان بهانه ای شد برای نوشتن این مطلب
سوال یک دوست این بود که سرعت نوشتن در دیسک در فایل سیستم های ext کمتر از فایل سیستم های دیگه هست اما چرا ؟
#filesystem #ext #journal @unixmens
سوال یک دوست این بود که سرعت نوشتن در دیسک در فایل سیستم های ext کمتر از فایل سیستم های دیگه هست اما چرا ؟
#filesystem #ext #journal @unixmens
فایل سیستم های ext3-4 از قابلیت journalization و کشینگ استفاده میکنن دقت کنید مبحث کشینک و journalizationدر ext3 به بعد ظهور کرد .
اما چطور بفهمیم قابلیت کشینگ فعال هست یانه ؟!؟
قبلش مفهوم جورنال در فایل سیستم را بررسی میکنم
#filesystem #ext #journal @unixmens
اما چطور بفهمیم قابلیت کشینگ فعال هست یانه ؟!؟
قبلش مفهوم جورنال در فایل سیستم را بررسی میکنم
#filesystem #ext #journal @unixmens
در مباحث ذخیرهسازی، سیستم فایل ژورنالی به سیستم فایلی میگویند که تغییرات را قبل از اعمال کردن در سیستم فایل اصلی در ناحیه مخصوصی به نام ژورنال پیگیری و نگهداری میکند. اغلب اوقات، ناحیه ژورنال، ناحیهای از سیستم فایل است که وقایع و تغییرات به صورت گردشی در آن ثبت میشوند. بدین ترتیب، در هنگام پیشآمدن مشکلی برای سیستم فایل همانند قطع شدن برق، سیستم فایل با کمترین احتمال خرابی میتواند به سرعت آماده به کار شود.
#filesystem #ext #journal @unixmens
#filesystem #ext #journal @unixmens
حال چطور میتونیم بفهمیم قابلیت کشینگ فعال هست ، و چطور میشه اون را ِیر فعال کرد ؟
با دستور زیر میشه پی برد :
hdparm -W /dev/sdX
—----------------خروجی---------------------
/dev/sda6: │
write-caching = 1 (on)
برای دانستن اطلاعات درمورد فایل سیستم ext ما :
tune2fs -l /dev/sdX
—----خروجی // اطلاعات زیادی هست ما فقط بعضی از اطلاعات را قرار میدیم------------
Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 128000
Block count: 512000
Reserved block count: 25600
Free blocks: 494994
Free inodes: 127979
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 124
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8000
Inode blocks per group: 500
Filesystem created: Sun Dec 15 12:59:05 2013
Last mount time: Thu Nov 3 13:01:13 2016
Last write time: Sat Feb 4 12:20:36 2017
Mount count: 66
Maximum mount count: -1
Last checked: Sun Dec 15 12:59:05 2013
Check interval: 0 (<none>)
Lifetime writes: 1208 kB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 1aff2a74-3388-4488-b525-ad15cf92a180
Journal backup: inode blocks
#filesystem #ext #journal @unixmens
با دستور زیر میشه پی برد :
hdparm -W /dev/sdX
—----------------خروجی---------------------
/dev/sda6: │
write-caching = 1 (on)
برای دانستن اطلاعات درمورد فایل سیستم ext ما :
tune2fs -l /dev/sdX
—----خروجی // اطلاعات زیادی هست ما فقط بعضی از اطلاعات را قرار میدیم------------
Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 128000
Block count: 512000
Reserved block count: 25600
Free blocks: 494994
Free inodes: 127979
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 124
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8000
Inode blocks per group: 500
Filesystem created: Sun Dec 15 12:59:05 2013
Last mount time: Thu Nov 3 13:01:13 2016
Last write time: Sat Feb 4 12:20:36 2017
Mount count: 66
Maximum mount count: -1
Last checked: Sun Dec 15 12:59:05 2013
Check interval: 0 (<none>)
Lifetime writes: 1208 kB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 1aff2a74-3388-4488-b525-ad15cf92a180
Journal backup: inode blocks
#filesystem #ext #journal @unixmens
برای غیر فعال کردن قابلیت کشینک داریم :
/dev/sda1 / reiserfs sync 0 0
برای ابن کار میتونبد در فایل /etc/fstab مثل این ساختار را اضافه کرد
#filesystem #ext #journal @unixmens
/dev/sda1 / reiserfs sync 0 0
برای ابن کار میتونبد در فایل /etc/fstab مثل این ساختار را اضافه کرد
#filesystem #ext #journal @unixmens
اما در مورد sync :
sync All I/O to the filesystem should be done synchronously. In the case of media with a limited number of write cycles (e.g. some
flash drives), sync may cause life-cycle shortening.
—------------------------------------------------------
inode_cache
Enable free inode number caching. Defaults to off due to an overflow problem when the free space CRCs don't fit inside a
single page.
—---------------------------------------------------------------------—
nospace_cache
Disable freespace cache loading without clearing the cache.
—----------------------------------------------------------------------
clear_cache
Force clearing and rebuilding of the disk space cache if something has gone wrong.
—------------------------------------------------------------------------------
inode_readahead_blks=n
This tuning parameter controls the maximum number of inode table blocks that ext4's inode table readahead algorithm will pre-
read into the buffer cache. The value must be a power of 2. The default value is 32 blocks.
—---------------------------------------------------------------------------------------—
nodelalloc
Disable delayed allocation. Blocks are allocated when data is copied from user to page cache.
—-------------------------------------------------------------------------------------------------
این ساختار ها را میشه بصورت مستقیم با دستور mount وارد کرد
#filesystem #ext #journal @unixmens
sync All I/O to the filesystem should be done synchronously. In the case of media with a limited number of write cycles (e.g. some
flash drives), sync may cause life-cycle shortening.
—------------------------------------------------------
inode_cache
Enable free inode number caching. Defaults to off due to an overflow problem when the free space CRCs don't fit inside a
single page.
—---------------------------------------------------------------------—
nospace_cache
Disable freespace cache loading without clearing the cache.
—----------------------------------------------------------------------
clear_cache
Force clearing and rebuilding of the disk space cache if something has gone wrong.
—------------------------------------------------------------------------------
inode_readahead_blks=n
This tuning parameter controls the maximum number of inode table blocks that ext4's inode table readahead algorithm will pre-
read into the buffer cache. The value must be a power of 2. The default value is 32 blocks.
—---------------------------------------------------------------------------------------—
nodelalloc
Disable delayed allocation. Blocks are allocated when data is copied from user to page cache.
—-------------------------------------------------------------------------------------------------
این ساختار ها را میشه بصورت مستقیم با دستور mount وارد کرد
#filesystem #ext #journal @unixmens
البته پارامتر های زیر را هم میشه در کرنل اعمال کرد :
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
#filesystem #ext #journal @unixmens
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
#filesystem #ext #journal @unixmens
نکته دیگه :
با دستور hdparm هم میشه انجام داد :
hdparm -W0 /dev/sda6
—-----------------------------خروجی---------------------------------
/dev/sda6:
setting drive write-caching to 0 (off)
write-caching = 0 (off)
#filesystem #ext #journal @unixmens
با دستور hdparm هم میشه انجام داد :
hdparm -W0 /dev/sda6
—-----------------------------خروجی---------------------------------
/dev/sda6:
setting drive write-caching to 0 (off)
write-caching = 0 (off)
#filesystem #ext #journal @unixmens
Forwarded from Academy and Foundation unixmens | Your skills, Your future
کانالی در حوزه اپن سورس ، گنو/لینوکس ، امنیت و ... دوست داشتین عضو بشین یا به دیگران معرفی کنید
@unixmens
@unixmens
آیا میدانید با ابزار وایرشارک میتوانید مشکلات شبکه را تشخیص و حل کنید ؟!؟
در زیر مواردی که می توانید انجام دهید به اختصار آورده شده است
#wireshark #security @unixmens
در زیر مواردی که می توانید انجام دهید به اختصار آورده شده است
#wireshark #security @unixmens
به دنبال نوشتن سرفصل هایی هستم برای کلاس آموزشی (آنلاین یا حضوری )، که قطعا برای مدیران IT ارزشمند خواهد بود
#wireshark #security @unixmens
#wireshark #security @unixmens
اسلایدهای دیروز را میتونید از این لینک مشاهده کنید :
https://www.slideshare.net/yasharesmaildokht/git2-77694712
#git #github #gitlab #yashar_esmaildokht @unixmens
https://www.slideshare.net/yasharesmaildokht/git2-77694712
#git #github #gitlab #yashar_esmaildokht @unixmens
www.slideshare.net
Git2
Git and github Presenter : yashar esmaildokht