你如何处理大量的小文件?

编程入门 行业动态 更新时间:2024-10-20 20:53:52
本文介绍了你如何处理大量的小文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我工作的产品每天收集数千个读数,并将它们存储在NTFS分区(Windows XP)上的64k二进制文件中。经过一年的生产,单个目录中有超过30万个文件,数量不断增长。这使得从Windows资源管理器访问父/祖先目录非常耗时。

我试过关闭索引服务,但是没有任何区别。我也考虑将文件内容移动到数据库/ zip文件/ tarball中,但是对于我们单独访问文件是有益的;基本上,这些文件仍然是研究目的所需要的,研究人员不愿意处理其他任何事情。

有没有办法优化NTFS或Windows,以便它可以处理所有这些小文件?

解决方案

NTFS性能在目录中的10,000个文件之后严重降级。你所做的是在目录层次结构中创建一个额外的级别,每个子目录有10,000个文件。

值得一提的是,这是SVN人员所采取的方法 1.5版。他们使用了1,000个文件作为默认阈值。

A product that I am working on collects several thousand readings a day and stores them as 64k binary files on a NTFS partition (Windows XP). After a year in production there is over 300000 files in a single directory and the number keeps growing. This has made accessing the parent/ancestor directories from windows explorer very time consuming.

I have tried turning off the indexing service but that made no difference. I have also contemplated moving the file content into a database/zip files/tarballs but it is beneficial for us to access the files individually; basically, the files are still needed for research purposes and the researchers are not willing to deal with anything else.

Is there a way to optimize NTFS or Windows so that it can work with all these small files?

解决方案

NTFS performance severely degrades after 10,000 files in a directory. What you do is create an additional level in the directory hierarchy, with each subdirectory having 10,000 files.

For what it's worth, this is the approach that the SVN folks took in version 1.5. They used 1,000 files as the default threshold.

更多推荐

你如何处理大量的小文件?

本文发布于:2023-05-28 06:55:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/315112.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何处理   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!