mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #387] PROPFIND method support infinity depth #202
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xiaozhuai on GitHub (May 16, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/387
Specific Demand
PROPFIND methid can provide a
depthparameter in the header, it accept0,1,infinity:Please support infinity depth.
@sigoden commented on GitHub (May 16, 2024):
Are there any common usage scenarios for this feature?
dufs is a lightweight web server and does not promise to support all webdav specifications (for example, it does not support lock/unlock).
This feature can have a significant impact on server performance.
We are not prepared to support if it is not necessary. hope you can understand.
@xiaozhuai commented on GitHub (May 16, 2024):
I use dufs as cache server for vcpkg. But as time goes by, more and more files will be cached, taking up more and more space. So I need to scan all cache files regularly and remove expired files.
This requires being able to list all files in a directory recursively.
Of course, I could propfind one directory at a time and call it recursively until I get all the files.
But the problem is that there are a large number of requests between the client and the server.
If infinity depth is supported, the result can be obtained in one request.
I understand. I wonder if we could make this an optional
allow-propfind-infinityfeature?This feature is actually very important for those who need to list files recursively.
@sigoden commented on GitHub (May 16, 2024):
Why I do not support this feature?
Suggestion
You can write a python script to generate a file list of all subdirectories in a directory and export it as
manifest.json. Set up the appropriate crontab task according to your needs. Create a special directory in dufs to serve themanifest.json, and all problems will be solved.Ask gpt to write the script:
@xiaozhuai
@xiaozhuai commented on GitHub (May 16, 2024):
I switch to nginx, it also didn't support propfind infinity.
And I've update my script, now it support list files in parallel.
Total file count is 1435.
Here is a benchmark result. The parallel num is 1, 4, 8, 32.
Under dufs, increasing parallel num does not give good gains, but the nginx did.
And when the parallel num reaches a certain value(>= 8), the performance drops sharply.
For nginx, although there will be no significant benefit after the parallel num is greater than 8, there will be no performance degradation.
nginx
dufs
@xiaozhuai commented on GitHub (May 16, 2024):
Here is the code snippets I use to get files recursively
@sigoden commented on GitHub (May 16, 2024):
I will research the performance issues later.
We do not currently plan to support infinite depth, so we are closing this issue.