-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello everyone, I been using CF cards for almost more then 7 years now with ext file-system without any major problems on ALIX boards. Last year I took 30 other systems in production with ext4 and the CF cards been dropping out pretty fast, it may have been a bad batch but I do want to look at it. I don't think the devices writes a lot of IO (is there a tool that can give me some useful numbers for say 24H or a week? iotop, atop, sysstat doesn?t seem suited for long term IO write monitoring, but maybe I am misusing them and can use some help here) I mount root with the following options: /dev/disk/by-uuid/09a04c01-64c6-4600-9e22-525667bda3e3 on / type ext4 (rw,noatime,user_xattr,barrier=1,data=ordered) # dumpe2fs /dev/sda1 http://paste.debian.net/hidden/e3f81f11/ Are there kernel options to avoid synchronous disk writes? As suggested here: http://www.pcengines.ch/cfwear.htm Is there a list of other kernel options I can optimise to limit any cf wear? The devices don't use Kind regards Jelle de Jong -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iJwEAQECAAYFAlQ1ZhgACgkQ1WclBW9j5HmulgP9Fayd7V9t7bRgLo6NmjDVZoDM f+kH54/EnjsRfoKYYZDSO38WlwBWqJ1cFc+w2W2PMWKqJiL7QNk2+qMsSFeTCtLq JTz/e2ItLNqFJTAtX0bROgbEmNubfLQyvli+q/HspeSHGKKHjBzHelv5PDBciQCm vJEVwtB3Vb22hsWfSmw=oCCY -----END PGP SIGNATURE-----
On Oct 8, 2014, at 10:28 AM, Jelle de Jong <jelledejong at powercraft.nl> wrote:> Hello everyone, > > I been using CF cards for almost more then 7 years now with ext > file-system without any major problems on ALIX boards. > > Last year I took 30 other systems in production with ext4 and the CF > cards been dropping out pretty fast, it may have been a bad batch but > I do want to look at it. I don't think the devices writes a lot of IO > (is there a tool that can give me some useful numbers for say 24H or a > week? iotop, atop, sysstat doesn?t seem suited for long term IO write > monitoring, but maybe I am misusing them and can use some help here)You can see in the ext4 superblock the amount of data that has been written to a filesystem over its lifetime: dumpe2fs -h /dev/vg_mookie/lv_home dumpe2fs 1.42.7.wc2 (07-Nov-2013) Filesystem volume name: home Last mounted on: /home : : Lifetime writes: 27 GB : : Note that this number isn't wholly accurate, but rather a guideline. IIRC it is not updated on disk all the time, so may lose writes. You can also get this information from /sys/fs/ext4 including data just for the current mount: # grep . /sys/fs/ext4/*/*_write_kbytes /sys/fs/ext4/dm-0/lifetime_write_kbytes:77632360 /sys/fs/ext4/dm-0/session_write_kbytes:7124948 /sys/fs/ext4/dm-19/lifetime_write_kbytes:28081448 /sys/fs/ext4/dm-19/session_write_kbytes:16520 /sys/fs/ext4/dm-2/lifetime_write_kbytes:60847858 /sys/fs/ext4/dm-2/session_write_kbytes:7739388 /sys/fs/ext4/dm-7/lifetime_write_kbytes:22385952 /sys/fs/ext4/dm-7/session_write_kbytes:6379728 /sys/fs/ext4/sda1/lifetime_write_kbytes:835020 /sys/fs/ext4/sda1/session_write_kbytes:60848> I mount root with the following options: > > /dev/disk/by-uuid/09a04c01-64c6-4600-9e22-525667bda3e3 on / type ext4 > (rw,noatime,user_xattr,barrier=1,data=ordered) > > # dumpe2fs /dev/sda1 > http://paste.debian.net/hidden/e3f81f11/ > > Are there kernel options to avoid synchronous disk writes? As > suggested here: http://www.pcengines.ch/cfwear.htmIf you increase the journal commit interval (e.g. 30s) you can reduce the number of times a block needs to be written to the journal. The drawback is that you also increase the amount of un-sync'd metadata that would be lost in case of a crash. This usually means the data would also be lost, unless you are using a database-like workload that overwrites the same files continuously.> Is there a list of other kernel options I can optimise to limit any cf > wear? The devices don't use > > Kind regards > > Jelle de Jong > > > _______________________________________________ > Ext3-users mailing list > Ext3-users at redhat.com > https://www.redhat.com/mailman/listinfo/ext3-usersCheers, Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP using GPGMail URL: <http://listman.redhat.com/archives/ext3-users/attachments/20141010/8eed94c6/attachment.sig>
Something else that you might want to do is count the number of journal commits that are taking place, via a command like this: perf stat -e jbd2:jbd2_start_commit -a sleep 3600 This will count the number of jbd2 commits are executed in 3600 seconds --- i.e., an hour. If you are running some workload which is constantly calling fsync(2), that will be forcing journal commits, and those turn into cache flush commands that force all state to stable storage. Now, if you are using CF cards that aren't guaranteed to have power-loss protection (hint: even most consumer grade SSD's do not have power loss protection --- you have to pay $$$ for enterprise-grade SLC SSD's to have power loss protection --- and I'm guessing most CF cards are so cheap that they won't make guarantees that all of their flash metadata are saved to stable store on a power loss event) the fact that you are constantly using fsync(2) may not be providing you with the protection you want after a power loss event. Which might not be a problem if you have a handset with a non-removable eMMC device and a non-removable battery that can't fly out when you drop the phone, but for devices which which can easily have unplanned power failure, it may every well be the case that you're going to be badly burned across a power fail event anyway. So the next question I would ask you is whether you care about unplanned power failures. If so, you probably want to test your CF cards to make sure they actually will do the right thing across a power failure --- and if they don't, you may need to replace your CF card provider. If you don't care (because you don't have a removable battery, and the CF card is permanently sealed inside your device, for example), then you might want to consider disabling barriers so you're no longer forcing synchronous cache flush commands to be sent to your CF card. This trades off power failure safety versus increased performance and decreased card wear --- but if you don't need power failure safety, then it might be a good tradeoff. And if you *do* need power fail protection, then it's a good thing to test whether your hardware will actually provide it, so you don't find out the hard way that you're paying the cost of decreased performance and increased card wear, but you didn't get power fail protection *anyway* because of hardware limitations. Cheers, - Ted
* Andreas Dilger <adilger@dilger.ca> hat geschrieben:> You can see in the ext4 superblock the amount of data that has been > written to a filesystem over its lifetime: > > Note that this number isn't wholly accurate, but rather a guideline.Is is more like a completely bogus value at best: # LANG=C df -h / | grep root /dev/root 3.7T 3.6T 73G 99% / # grep [0-9] /proc/partitions 8 0 3907018584 sda # tune2fs -l /dev/sda | grep Lifetime Lifetime writes: 2503 GB 3.7 TB Disk/Partition, 3.6 TB space in use but only 2.4 TB writes. No, there are no 1.2 TB + x allocated but never written to clusters on that file system. And if /sys/fs/ext4/*/*_write_kbytes are as correct as the "Lifetime writes" value, than the correct answer to Jelle's question is: "There is no way currently to figure out the actual number of writes to a device". Regards, Bodo