Issue to read millions of small files form one directory
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
for example ls by default sorts the filenames, so it must read all the entries of the directory before showing the content. ls -U may help on this. But probably better to use another tool to read a dir file by file.
Image processing must take much longer then fetching a filename (in general).
Without knowing actually what's going on extremely hard to catch the bottleneck. Probably it is in line 43.
The stat of the directory is what is taking time, not the size of files. That is why hashing the path to reduce directory size is done. I've converted a filesystem to a database lookup to fix the problem also, databases are optimized for lookups. I'd say it will never work as designed.
Thanks.
Any distributed filesystem or filesystem like btrfs would help?
Again, as you've been told several times, you haven't given us any real details about what you're trying to do, how, or describe your actual goal. Saying "read small image files" tells us nothing. You hint at multiple clients (running what? Attached how), over a network (LAN? WAN? VPN? what?) to do 'manipulation' (what kind? Using what program?).
Without details and a clear question, there's nothing we can tell you that would be meaningful.
Any distributed filesystem or filesystem like btrfs would help?
You have given us inadquate data to make any other than general comments. We need far more detail, and better detail, about your hardware and network situation, your processes, your data, files, and structures, and far more data about the processes that create or deliver these objects and about how and why you intend to process these objects. You have us shooting at goldfish, in a barrel, without lights, in the dark. Even if we his something, we will never know.
Can you give us enough information to actually work on?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.