New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use sendfile system call on Linux in HTTPServerResponseImpl::sendFile #3277
Comments
It would require exposing the file descriptors, either at the |
This issue is stale because it has been open for 365 days with no activity. |
This issue was closed because it has been inactive for 60 days since being marked as stale. |
This issue was closed because it has been inactive for 60 days since being marked as stale. |
At the moment,
HTTPServerResponseImpl::sendFile
usesStreamCopied::copyStream
which in turn uses intermediate buffer copies. This is inefficient on Linux as the buffers are copied from user space to user space and again from user space to kernel space.poco/Net/src/HTTPServerResponseImpl.cpp
Line 131 in 3fc3e5f
poco/Foundation/src/StreamCopier.cpp
Line 36 in 3fc3e5f
As the size of the file increases this will become evident as the kernel buffer cache will get filled up pretty quickly and we have to resort to running
Linux has
sendfile
system call. This can be used to speed up the sends and also minimize the memory usage of the process and in turn reduce the kernel buffer cache.The text was updated successfully, but these errors were encountered: