ソースの表示以前のリビジョンバックリンク全て展開する/折り畳む文書の先頭へ Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer Reddit Teams最近の変更Send via e-Mail印刷パーマリンク × 目次 SambaとZFSで大量のファイルを扱う時はcase-sensitiveを最適化する おさらい ではどうするか 結論 参考サイト « EmacsのCompletionsバッファを新規ウィンドウではなく既存ウィンドウに表示させる HPE iLO 4の機能比較表 » SambaとZFSで大量のファイルを扱う時はcase-sensitiveを最適化する 同一フォルダに大量のファイルがあるとSambaが超遅くなる問題、自分なりの知見が得られたのでメモ。結果だけ知りたい人は最後までスクロールしてくだしあ。 おさらい ことの発端は、数万個のファイルがあるフォルダをSambaのファイルサーバにコピーすると、速度が10kB/s前後まで低下する現象に見舞われた。速度はコピーが進むごとに低下し、比例してsmbdのCPU占有率が上がるというのが特徴。サーバ上で直接コピーすると何の問題もない。 調査を進めると、Sambaはファイル名の重複チェックのため、ファイル作成時に作成先フォルダ内の全ファイル名を検査することが分かった。この時に行われる、ファイル名の大文字/小文字変換と比較処理がボトルネックとなっているようだ。Windowsでは歴史的にファイル名の大文字/小文字を区別しない1)が、UNIX系ではOS/ファイルシステム共に大文字/小文字を区別することが多い。このWindowsとUNIXの違いをSambaで吸収してやる必要があるわけだ。 プロファイルしたわけでもソースコードを見たわけでもないので確証はないが、Sambaのドキュメントに「ディレクトリに大量のファイルがある特殊なケースでは、case sensitiveをyesにせよ」(抄訳)と書かれており、ファイルコピーの進捗にあわせ指数関数的に速度が落ちる(CPU負荷が上がる)という挙動から、当たらずとも遠からずだと思う。 ではcase sensitive = yesにすれば万事解決かといえば、そう簡単な話ではない。 前述の通りWindowsはFS的にはcase-sensitiveないしcase-preservingだが、表面的にはcase-insensitiveとして振る舞う。この仕様に胡坐をかき、ファイルパスを内部的に大文字または小文字に変換して扱うアプリケーションが少なくない。例えば、本来のファイルパスはC:\Data\FILE.datにもかかわらず、アプリケーション内部ではc:\data\file.datとして扱うことが往々にある。(自分もそういう処理をつい書いちゃうんだけど(;'∀'))。 ローカルのファイルに対してなら、Windowsがよしなに取り計らってくれるので問題にはならない。 しかし、共有フォルダのアクセスに関しては、忖度することなくリクエストされたファイルパスをそのままサーバに渡しているようだ。ゆえにサーバ側でそのあたりが考慮されてないと、意図したファイルが見つからないという事になる。Sambaのcase sensitiveオプションは、まさにその辺の制御に関するオプションなのだ。 case sensitive=yesにするということは、\\Server\Data\FILE.datと\\Server\data\file.datは別のファイル扱いになるということで、手抜きアプリからすれば、case-insensitiveなら見えていたファイルが見つからなくなる。これでは使い物にならない2) ではどうするか そこでZFSのcasesensitivityプロパティの登場だ。 その名の通り、ファイル名の大文字/小文字の取り扱いに関するプロパティで、デフォルト値はcasesensitiveである。 これをcaseinsensitiveにしてやれば、大文字/小文字を区別しないようにファイルシステムが処理するようになる。“insensitive”とはなっているけど、挙動としては“preserving”のようだ。ちなみに、mixedというのもあるが、使いどころがよくわからない挙動なので指定しない方が無難(一応、Windowsを想定した挙動らしいんだけど…)。 残念ながら、というか性質を考えたら仕方ないけど、本プロパティはデータセット作成時にしか指定できない。既に問題が起きてしまっている場合は、caseinsensitiveなデータセットを新たに作り、casesensitiveの方からファイルコピーで移行するしかない。(zfs send/recvではプロパティが引き継がれるので意味がない。) そのうえでSamba側のcase sensitive=yesとしてやれば、smbdの負荷問題は解決する。 Sambaがファイル作成時にファイル名を全舐めしてしているのは、対象フォルダに対する変更をSamba側で検知する術がないからだと思われる。Sambaがファイルを作成しようとしたまさにその時、同名のファイルがサーバのローカルで作られたりする可能性があるから、キャッシュではファイル名のユニーク性を担保できず、都度確認せざるを得ないのだろう。 一方、ファイルシステムレベルなら、ファイル名の一意性やアトミック性の保証が効率的に行えているだろうという目論見。 結論 結論としてはSambaとZFSで以下の設定を行うと幸せになれる。ZFSじゃない人はスマン… ZFS ファイル共有用にcasesensitivity=caseinsensitiveなFSを作るzfs create -o casesnsitivity=caseinsensitive ztank/path/to/cifs Samba ファイル名の扱いをcase-sensitiveにする case sensitive = yes case preserve = yes short preserve case = yes (2021-05-17 追記) 上記設定について、以前はcase preserve, short preserve caseをnoとしていたが、yesの方が良さそうである。これらはファイル新規作成時のファイル名の大文字・小文字の取り扱いのオプションで、noだと大文字ないし小文字に変換されていまう(default caseの指定に因る。デフォルト値はlowerなので小文字になる。) 参考サイト smb.conf — The configuration file for the Samba suiteのNAME MANGLINGセクション 1) ファイルシステム上は区別して保存されている。この差はAPIで吸収され傍目からはcase-preservingのように見える 2) 実際、某有名3Dモデリングソフトでアセットファイルが突然見えなくなるという現象に遭遇している Comments Howdy, buddy! It's always a pleasure to see your friendly face, my friend. Hi there! We appreciate the informative content on your website. Given your focus on sustainability, we believe our battery recycling initiative would be of great interest to your visitors <a href=http://akum.tel/>Battery recycling for instant cash</a> Adieu, and goodbye for now, and keep inspiring 1 | Aluminium scrap sustainability practices | 2024-12-14 09:20 | reply osugeseyi96@gmail.com 2 | Charleschugs | 2024-12-16 11:37 | reply Shalom, wise one! I can't wait to soak up your knowledge. Exploring this site felt like discovering a hidden beach cove, where the warm color scheme and user-friendly navigation create a calming ambiance. The thoughtful layout showcases the owner's expertise in digital design, making every visit feel like a mini getaway. Visit my site and see what’s happening <a href=http://akb.wang/>Cash for battery recycling</a> Have a beautiful day, my friend, and goodbye, take care 3 | Shivon Daybel | 2024-12-17 04:29 | reply Aloha, my friend! This is gonna be the start of something special. This website grabbed my attention like a stunning launch at WhatsApp. The vivid graphics and engaging format are both inviting and informative. Will Cathcart would definitely see the benefits of hiring this creator as a User Experience Designer to enhance their platform further. I invite you to see what I’ve created—your opinion is valued: <a href=http://alumi.bid/>Recycle your aluminum</a> 4 | Kirke Fir | 2024-12-17 15:15 | reply “Julia's Garland” (fr. Guirlande de Julie) 5 | Scannerajv | 2024-12-31 05:13 | reply Exploring this site was like catching a sunbeam on a pristine Caribbean beach. The inviting color palette and soothing graphics make it feel like a luxurious escape, crafted by a masterful beach resort manager who knows exactly how to create an atmosphere that puts you at ease. Take a look at what I have online <a href=http://alumin.tel/info/chto-takoe-boksity>WhAt DO baUxIteS lOok liKE</a> 6 | Jilli Havis | 2025-01-05 11:36 | reply Just thinking about you gives me chills… come closer - https://rb.gy/es66fc?boularee 7 | AmandaKagrinna3 | 2025-01-05 17:56 | reply antiquities. These are the Egyptian papyri 8 | Premiumgpx | 2025-01-10 21:47 | reply Der <a href=“https://solo.to/slotpark-bonus”>slotpark bonus code 2025</a> ist die perfekte Gelegenheit fГјr neue Spieler! Hole dir jetzt deine tГ¤glichen Boni. 9 | SlotparKirock | 2025-01-30 06:17 | reply egodlevskaya61@gmail.com 10 | HectorHen | 2025-02-02 09:26 | reply Sichere dir den <a href=“https://www.horseracingnation.com/user/code”>slotpark bonus code heute</a> fГјr noch mehr SpielspaГџ! Hol dir kostenloses Spielgeld und starte sofort. 11 | SlotparKirock | 2025-02-02 09:52 | reply Ciao, intriguing individual! I'm hyped to learn more about you. Exploring this site was akin to wandering through an enchanting tropical rainforest in Costa Rica, where the visuals are as lush and vibrant as the diverse flora and fauna. The immersive graphics and easy navigation allow me to feel the excitement of discovery with each new click, as if I'm hiking through hidden trails. The owner likely has the expertise of an ecotourism guide, seamlessly connecting us to the wonders of nature. Your site is like a scrumptious fruit tart—colorful and fresh! I’d love to collaborate with a tart artisan like you <a href=http://cuprum.top/>Copper scrap recycling company</a> Until we meet again, and may your heart be as light as a feather 12 | Nadyna Titterton | 2025-02-09 09:26 | reply 39cd018 <a href=https://gotwebsite1.com/local-seo-phoenix/>Best white-hat SEO firm in NYC</a> 13 | Edwinborne | 2025-02-16 14:51 | reply Ensuring the safety of your company is crucial in today's competitive marketplace. Among the most effective ways to protect your business assets and monetary documents is by committing in a reliable commercial safe. Regardless of whether you're storing funds, important records, or classified data, a safe provides a necessary layer of safety for your enterprise. When picking a safe for commercial use, there are actually a number of elements to think about. First and foremost, evaluate your company's protection necessities. Establish what items need security and the degree of security necessary. Following, take into account the size and kind of safe required for your business. Opt for a safe that is fits within your business's room while supplying sufficient storage for belongings. Think about whether or not the safe requires extra functions such as fire resistance or water resistance. Additionally, look into the protective elements of the safe. Seek out attributes such as high-tech locking mechanisms, sturdy construction, and tamper resistance. Consider investing in a safe with added security measures such as fingerprint scanners or digital keypads. Lastly, make sure the safe matches inside your business's budget. Set a reasonable budget based on your protection necessities and investigate options that match within your financial constraints. Ultimately, choosing the appropriate safe for your company is critical for securing your company resources. By appraising your security needs, considering the capacity and variety of safe needed, looking into security features, and setting a budget, you can ensure optimal protection for your business. Scottsdale safe deals - https://mercurylock.com/ 14 | KarenAposy | 2025-02-20 10:30 | reply Duke de Montosier 15 | Carpetncm | 2025-02-21 04:04 | reply Hallo, future companion! I'm eager to learn from you. The dynamic visuals here are as refreshing as enjoying a cold pina colada during summer, vibrant and bursting with flavor. It keeps me engaged, enticing further exploration of the rich content. I appreciate this opportunity to express my feedback. You're welcome to see what I've put online <a href=http://a.ny3blpuku.cc/>Buy beer with delivery</a> Sayonara, and may serenity find you wherever you go 16 | Aiuto Buttery | 2025-02-22 00:15 | reply Just dropped by to say hello! I'm happy to be here and looking forward to become part of the community. Hi all! Just wanted to say that I've been spinning reels at <link> and it's been super fun. The jackpots are phenomenal! <a href=“https://hu.velo.wiki/index.php?title=Casino_888GCC”>ШЈЩ„Ш№Ш§ШЁ Ш§Щ„Щ‚Щ…Ш§Ш± ЩЃЩЉ 888GCC</a> <a href=“http://how2youtube.com/g/bbs/board.php?bo_table=free&wr_id=1961444”>TAYA365 secure transactions</a> <a href=“http://wiki.svencremer.com/index.php/Minha_Experi%C3%AAncia_No_PagBet:_Como_Potencializar_Seus_Ganhos_E_B%C3%B4nus”>Apostas esportivas</a> <a href=“https://cl-system.jp/question/%d8%a3%d9%82%d9%88%d9%89-%d8%a7%d8%b3%d8%aa%d8%b1%d8%a7%d8%aa%d9%8a%d8%ac%d9%8a%d8%a7%d8%aa-%d8%a7%d9%84%d8%b1%d9%87%d8%a7%d9%86%d8%a7%d8%aa-%d8%a7%d9%84%d8%b1%d9%8a%d8%a7%d8%b6%d9%8a%d8%a9-%d8%b9-2/”>1xbet casinoo</a> <a href=“http://www.kmelec.com/bbs/board.php?bo_table=free&wr_id=86005”>BГґnus Pagbet</a> <a href=“https://certainlysensible.com/index.php/Win_Big_At_Taya365”>TAYA365 welcome bonus</a> <a href=“https://si-sudagro.net/cdc-hiruak/index.php?qa=367506&qa_1=le-tue-vincite-aspettano-winnita-scopri-nuove-opportunit%C3%A0”>Registrazione Winnita</a> <a href=“http://www.mouneyrac.com/free/non-perdere-loccasione-vinci-con-winnita-casino/”>Slot Winnita</a> <a href=“http://kakaokrewmall.com/bbs/board.php?bo_table=free&wr_id=253123”>ШЈЩ„Ш№Ш§ШЁ Ш§Щ„Щ‚Щ…Ш§Ш± ЩЃЩЉ 888GCC</a> <a href=“https://mcmlxxii.net/index.php?title=Scopri_Le_Slot_Online_Su_Winnita_Casin%C3%B2:_Gira_Con_Il_Brivido_Puro”>CasinГІ live Winnita</a> <a href=“https://parikshagk.in/forum/index.php?qa=131967&qa_1=aposte-no-pagbet-apostas-r%C3%A1pidas-e-100%25-seguras”>Apostas ao vivo</a> <a href=“https://king-wifi.win/wiki/%D9%85%D8%B1%D8%AD%D8%A8%D8%A7%D9%8B_%D9%81%D9%8A_1xBet_%D9%85%D8%B5%D8%B1”>1xbet casinoo</a> <a href=“https://wiki.team-glisto.com/index.php?title=A_Minha_Experi%C3%AAncia_No_PagBet:_Como_Maximizar_Seus_Lucros_E_B%C3%B4nus”>Apostas em futebol</a> <a href=“https://booksofhubris.com/Casino_888GCC”>ШЈЩ„Ш№Ш§ШЁ Ш§Щ„ЩѓШ§ШІЩЉЩ†Щ€ 888</a> <a href=“http://www.larsaluarna.se/index.php/Taya365_Pro:_Ang_Pinoy_Online_Casino_Na_Walang_Kasing_Saya”>TAYA365 withdrawal</a> Remember, even the most experienced players had losing streaks. What sets them apart is their resilience to keep going. You can do it too! The more you participate, the more you learn. Each game is a lesson to become a better player. 17 | DavidItarl | 2025-02-23 10:12 | reply Eye Movement Desensitization and Reprocessing Therapy for Sexual Assault Survivors and Regaining Healing and Wholeness. Intersexual attacks is some sort of painful experience that will may crack survivors' sense linked with safety, trust, along with well-being. Eye Movement Desensitizing and Processing Eye Movement Desensitization and Reprocessing therapy presents the precious source with regard to survivors connected with sexual violence, encouraging their experience toward healing, empowerment, and reclaiming their sense connected with self as well as wholeness. In this forum post, many of us explore the application associated with Eye Movement Desensitization and Reprocessing therapy in survivors of rape and also discuss its potential benefits pertaining to resolving injury-related concerns as well as promoting resilience as well as recovery. A single from the primary challenges faced by survivors associated with rape is definitely the pervasive impact associated with trauma on their mental, emotional, along with physical health. Eye Movement Desensitization and Reprocessing therapies provides the structured as well as evidence-based approach in order to trauma treatment that will can easily help survivors process distressing memories and also emotions, challenge disadvantage beliefs about themselves, along with establish a lot more adaptative problem management options. You'll also, Eye Movement Desensitization and Reprocessing therapy can address the actual advanced dynamics associated with sexual trauma, including issues for instance shame, guilt, and self-blame, that will survivors may struggle with within the aftermath linked with attack. By providing any safe in addition to helpful space for survivors to help experience their ideas as well as emotions, Eye Movement Desensitization and Reprocessing treatment empowers them to help recover their sense of agency in addition to self-worth. Furthermore, Eye Movement Desensitization and Reprocessing therapy's focus on restoring wholeness in addition to integration aligns with the actual goals connected with many survivors connected with rape, who are usually seeking for you to heal from their trauma and also move forward with their lives. By offering effective and efficient in addition to accessible traumatization treatment, Eye Movement Desensitization and Reprocessing therapy assists survivors with reclaiming their power and building some sort of lighter future free from the shadows linked with the previous. <a href=https://lkinstitute.com/training-schedule>Eye Movement Desensitization and Reprocessing therapy</a> <a href=http://ukrbizn.com/headline/>Household Treatment in Eye Movement Desensitization & Reprocessing</a> 239cd01 18 | Raymondtig | 2025-02-23 20:16 | reply Name E-Mail Website 人間の証明として、ボックス内の全ての文字を入力してください。 この項目は空のままにして下さい:Preview Comment blog/2018/2018-07-03.txt 最終更新: 2021-05-17 09:45by Decomo