-
Notifications
You must be signed in to change notification settings - Fork 32
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 buffer pool to avoid large buffer allocation for connections and responses #87
base: branch-2.6
Are you sure you want to change the base?
Conversation
AFAICS it builds & installs fine w/ jenkins (certainly builds for me). Same (phony?) uninstall error as in #84. |
Thanks for doing this. I haven't read the last-chunk part carefully, but the rest of the code looks OK to me. The overhead (hashtable, stacks, release closures) should be insignificant for buffers of size 1K or more. I can install and uninstall (the buffer-pool branch) just fine locally, it is hard to say why rm fails inside the docker container. |
On Mon, Aug 17, 2015 at 05:38:28AM -0700, Vasilis Papavasileiou wrote:
Thank you for taking a look :)
Indeed. In this case there's a speed increase across the board for any For hashtables of such size (a few dozen elements at most) I've measured over
I'm told it's an issue in the build script used for PRs. Mauricio Fernández |
A trivial buffer pool is used to get rid of these buffer allocations:
Ocsigen_http_com
)Ocsigen_senders.File_content
Moreover, some care is taken to avoid allocation for the last chunk of a file when the remaining data doesn't match the buffer size.
The changes are minimal, but reviews are appreciated. In particular:
Ocsigen_server
; it's literally 3 lines, but it's quite big conceptuallyOverall, these changes deliver up to ~25-30% more speed in some requests.
Performance
Effect of buffer pools
(buffer pool disabled with OCSIGEN_DISABLE_BUFFER_POOL -> enabled)
o=150 is the GC setting used in half of the runs
Effect of last-chunk optimization when serving files
Overall effect of
Lwt_chan
fix #49 + buffer pools + last-chunk optimization(only for files): compare figures at the top + those in POST to these for 2.6: