{"id":213,"date":"2024-06-23T23:09:49","date_gmt":"2024-06-24T06:09:49","guid":{"rendered":"https:\/\/pronoiac.org\/misc\/?p=213"},"modified":"2024-06-23T23:15:44","modified_gmt":"2024-06-24T06:15:44","slug":"file-systems-with-a-billion-files-making-forests-parallel-multitouch","status":"publish","type":"post","link":"https:\/\/pronoiac.org\/misc\/2024\/06\/file-systems-with-a-billion-files-making-forests-parallel-multitouch\/","title":{"rendered":"File systems with a billion files, making forests, parallel multitouch"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">about<\/h2>\n\n\n\n<p>Making file systems with a billion files is interesting for feeling out scaling issues.<\/p>\n\n\n\n<p><a href=\"https:\/\/pronoiac.org\/misc\/2024\/03\/file-systems-with-a-billion-files-intro-toc\/\">The Intro post for file systems with a billion files, with a table of contents<\/a>. This is <a href=\"https:\/\/pronoiac.org\/misc\/2024\/03\/making-file-systems-with-a-billion-files\/\">yet another way to make file systems with a billion files<\/a>. <\/p>\n\n\n\n<p>While working on the upcoming archiving and compression post, with various obstacles, yet another method for making those file systems came to mind: running multiple multitouch methods in parallel. Spoilers: It\u2019s the fastest method for making file systems with a billion files that I\u2019ve run.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">hardware<\/h2>\n\n\n\n<p>I worked from a Raspberry Pi 4, with 4 GB RAM, running Debian 12 (bookworm).\nIt has four cores.\nFor storage &#8211; this is new &#8211; I connected the Pi to my NAS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">environmental changes<\/h3>\n\n\n\n<p>While gathering data for the upcoming archiving and compression post, the first hard drive, a 2017-era Seagate USB hard drive, flaked out.\nWhen connected to my Pi, the drive would go offline, with kernel log messages involving \u201cover-current change\u201d &#8211; which might point at the power supply for the Pi.\nThis hard drive\u2019s shelved for now.<\/p>\n\n\n\n<p>The second spare drive I reached for was a 2023-era WD USB hard drive.\nIt was also an SMR drive, and the performance was surprisingly awful.\nAs in, I went looking for malware.\nPerhaps it just needs some time for internal remapping and housekeeping, but it\u2019s off to the side for now.<\/p>\n\n\n\n<p>I connected the Pi to my NAS, with redundant CMR hard drives, over Gigabit Ethernet.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">new repo<\/h2>\n\n\n\n<p>Before, I\u2019d placed a few scripts in a fork for create-empty-files; I\u2019m adding more and it feels like tangential clutter. So, <a href=\"https:\/\/gitlab.com\/pronoiac\/billion-file-fs\">I started a <code>billion-file-fs<\/code> repo<\/a>. I plan to put everything in this post there; see the <a href=\"https:\/\/gitlab.com\/pronoiac\/bffs\/-\/tree\/main\/scripts\"><code>scripts<\/code> directory<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">parallel multitouch<\/h2>\n\n\n\n<p>I realized I could run multiple multitouch in parallel.<\/p>\n\n\n\n<p>There&#8217;s a rule of thumb for parallel processes: the number of processor cores, plus one. I benchmarked with a million files, and one to ten processes; the peak was five, matching that expectation.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><thead><tr><th>processes<\/th><th>time<\/th><th>files \/ sec<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>1m57s<\/td><td>8490<\/td><\/tr><tr><td>2<\/td><td>1m5s<\/td><td>15200<\/td><\/tr><tr><td>3<\/td><td>50s<\/td><td>19700<\/td><\/tr><tr><td>4<\/td><td>45.2s<\/td><td>22000<\/td><\/tr><tr><td>5<\/td><td>43.7s<\/td><td>22800<\/td><\/tr><tr><td>6<\/td><td>44.1s<\/td><td>22600<\/td><\/tr><tr><td>7<\/td><td>45.0s<\/td><td>22100<\/td><\/tr><tr><td>8<\/td><td>44.8s<\/td><td>22200<\/td><\/tr><tr><td>9<\/td><td>44.8s<\/td><td>22200<\/td><\/tr><tr><td>10<\/td><td>45.0s<\/td><td>22100<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">how did it do?<\/h3>\n\n\n\n<p>It populated a billion files in under seven hours, a new personal record!<\/p>\n\n\n\n<p>Here are how the fastest generators ran, against NAS storage:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>method<\/th><th>time<\/th><th>space used<\/th><th>files\/sec<\/th><\/tr><\/thead><tbody><tr><td>multitouch on ext4<\/td><td>18hr36min<\/td><td>260GB<\/td><td>14900<\/td><\/tr><tr><td>Rust program on ext4<\/td><td>14hr14min<\/td><td>278GB<\/td><td>19500<\/td><\/tr><tr><td>Rust program on ext2<\/td><td>12hr48min<\/td><td>276GB<\/td><td>21700<\/td><\/tr><tr><td>parallel multitouch on ext4<\/td><td>6hr41min<\/td><td>260GB<\/td><td>41500<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Against the first USB drive, Rust &amp; ext2 was slower than ext4.\nThey switched places here, which surprised me.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">what\u2019s next?<\/h2>\n\n\n\n<p>Probably archiving and compression &#8211; it&#8217;s already much longer, with graphs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>about Making file systems with a billion files is interesting for feeling out scaling issues. The Intro post for file systems with a billion files, with a table of contents. This is yet another way to make file systems with a billion files. While working on the upcoming archiving and compression post, with various obstacles, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[17],"class_list":["post-213","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-billion-files"],"_links":{"self":[{"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/posts\/213"}],"collection":[{"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":6,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":219,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/posts\/213\/revisions\/219"}],"wp:attachment":[{"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}