mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[GH-ISSUE #2617] The performance decreases heavily for concurrent IOs. #1248
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#1248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 @fangqianan on GitHub (Dec 10, 2024).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2617
Additional Information
Version of s3fs being used (
s3fs --version)V1.95 (commit:561ce1e20600bab42133b5e51511483800d3ef76)
How to run s3fs, if applicable
All parameters are the default ones.
Details about issue
I started 10 processes, each of which writes 50 1MB files via s3fs concurrently. Then I read those files with the same concurrency. The performance decreases heavily as I raise up the concurrency. I tried to analyze the problem and here is what I found:
Thread 1: The flush/read api holds fent lock, and uploads files during holding this lock;

Thread 2: Writing/reading another file. In s3fs_write()/s3fs_read() -> AutoFdEntity::GetExistFdEntity() -> FdManager::GetExistFdEntity(), s3fs tried to find the other file's pseudo_fd by searching from all entities. Yet inside FindPseudoFd() every opened file's fent lock is required.

This means that once one file is being uploaded with its fent lock being held, there is a chance that other threads trying to read/write other files are blocked.
Actually, not only does this happen when a file is being uploaded, but also when a file is being downloaded in Read() with fent lock being held.
Given the information above, can you guys provide a solution to fix it? Or is there a reason why you guys designed the lock like this? Thanks!