[PR #350] [MERGED] update default value of max_idle_threads to keep consistent with libfuse #383

Closed
opened 2026-10-26 09:49:31 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/3FS/pull/350
Author: @nautaa
Created: 10/14/2025
Status: ✅ Merged
Merged: 10/14/2025
Merged by: @SF-Zhou

Base: main ← Head: update_max_idle_threads


📝 Commits (1)

  • a8beb55 update default value of max_idle_threads to keep consistent with libfuse

📊 Changes

2 files changed (+2 additions, -2 deletions)

View changed files

📝 configs/hf3fs_fuse_main.toml (+1 -1)
📝 src/fuse/FuseConfig.h (+1 -1)

📄 Description

During our testing(fio sequential read), we observed significant thread creation overhead, which ultimately traced to the creation of fuse_worker threads within libfuse. In libfuse, the default value for max_idle_threads is -1, and as the libfuse comments, it is recommended to set max_idle_threads to -1. max_idle_threads means the maximum number of idle worker threads. After exceeding max_idle_threads active threads, libfuse destroys redundant idle threads. This may result in frequent thread creation and destruction.

However, in 3FS, this value defaults to 10. In our test environment, setting max_idle_threads = 10 resulted in considerable overhead from thread creation and destruction. Therefore, I believe aligning the default value of max_idle_threads in 3FS with that of libfuse would be a more reasonable default choice.

github.com/libfuse/libfuse@564d79e4d3/lib/fuse_loop_mt.c (L185-L190)

		/* creating and destroying threads is rather expensive - and there is
		 * not much gain from destroying existing threads. It is therefore
		 * discouraged to set max_idle to anything else than -1. If there
		 * is indeed a good reason to destruct threads it should be done
		 * delayed, a moving average might be useful for that.
		 */
image

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/3FS/pull/350 **Author:** [@nautaa](https://github.com/nautaa) **Created:** 10/14/2025 **Status:** ✅ Merged **Merged:** 10/14/2025 **Merged by:** [@SF-Zhou](https://github.com/SF-Zhou) **Base:** `main` ← **Head:** `update_max_idle_threads` --- ### 📝 Commits (1) - [`a8beb55`](https://github.com/deepseek-ai/3FS/commit/a8beb55eccec8f62ccb381c3805ff67e98dd8161) update default value of max_idle_threads to keep consistent with libfuse ### 📊 Changes **2 files changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `configs/hf3fs_fuse_main.toml` (+1 -1) 📝 `src/fuse/FuseConfig.h` (+1 -1) </details> ### 📄 Description During our testing(fio sequential read), we observed significant thread creation overhead, which ultimately traced to the creation of fuse_worker threads within libfuse. In libfuse, the default value for max_idle_threads is -1, and as the libfuse comments, it is recommended to set max_idle_threads to -1. max_idle_threads means the maximum number of idle worker threads. After exceeding max_idle_threads active threads, libfuse destroys redundant idle threads. This may result in frequent thread creation and destruction. However, in 3FS, this value defaults to 10. In our test environment, setting max_idle_threads = 10 resulted in considerable overhead from thread creation and destruction. Therefore, I believe aligning the default value of max_idle_threads in 3FS with that of libfuse would be a more reasonable default choice. https://github.com/libfuse/libfuse/blob/564d79e4d3132924d33f0a0848b9d54c84b42a17/lib/fuse_loop_mt.c#L185-L190 ``` /* creating and destroying threads is rather expensive - and there is * not much gain from destroying existing threads. It is therefore * discouraged to set max_idle to anything else than -1. If there * is indeed a good reason to destruct threads it should be done * delayed, a moving average might be useful for that. */ ``` <img width="2394" height="1218" alt="image" src="https://github.com/user-attachments/assets/a95d5d0d-9a64-4c2b-97f0-b09c9a50649b" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 09:49:31 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/3FS#383
No description provided.