You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sendfile threshold is currently hardcoded to 200 KB in HttpResponseImpl.cc:312, making it impossible for users to tune this performance parameter for their specific workloads. This value determines the minimum file size for using the sendfile() syscall - files larger than this threshold use sendfile for efficiency, while smaller files are sent as regular responses.
Current Approach
Currently, the threshold is hardcoded:
if (HttpAppFrameworkImpl::instance().useSendfile() && length > 1024 * 200)
// TODO : Is 200k an appropriate value? Or set it to be configurable
This hardcoded value may not be optimal for all use cases:
Small VPS deployments might benefit from a larger threshold (e.g., 1MB) to reduce system calls
Large-scale servers might prefer a smaller threshold (e.g., 100KB) for better memory control
Different workloads (static files vs. media streaming) have different optimal values
This would be a simple but valuable enhancement. Should it be configurable, and not hardcoded? Thoughts?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The sendfile threshold is currently hardcoded to 200 KB in
HttpResponseImpl.cc:312, making it impossible for users to tune this performance parameter for their specific workloads. This value determines the minimum file size for using thesendfile()syscall - files larger than this threshold use sendfile for efficiency, while smaller files are sent as regular responses.Current Approach
Currently, the threshold is hardcoded:
This hardcoded value may not be optimal for all use cases:
This would be a simple but valuable enhancement. Should it be configurable, and not hardcoded? Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions