Skip to content
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

XrdBuffer: Decrement total buffer count when freeing buffers #571

Merged
merged 1 commit into from
Aug 24, 2017

Conversation

jthiltges
Copy link
Contributor

If the total buffer count (totbuf) is incorrectly high, the request profile (bufprof) will also be disproportionately high: it's scaled by the buffer count. The buffer pool is not reshaped, with too many buffers being held.

This patch decrements the total buffer count as buffers are deleted, matching the behavior of XrdBuffXL.

If the total buffer count (totbuf) is incorrectly high, the request profile
(bufprof) will also be disproportionately high: it's scaled by the buffer
count. The buffer pool is not reshaped and too much memory is held.
@bbockelm
Copy link
Contributor

To be clear, we believe this patch fixes memory hoarding observed when XrdHttp is used. Over time, we've seen the xrootd process hoard 40-60GB memory (linearly increases as a function of load) when HTTP is used heavily until systemd kills it.

@jthiltges
Copy link
Contributor Author

Related to this PR, I'm puzzled by the logic to reshape the XrdBuffer pool.

It scales the buckets of memory buffers proportional to the number of requests: If 50% of the requests are for buffers of size X, it adjusts the buffer count so that 50% of the buffers are size X.

However, the adjustment process doesn't consider the amount of memory being used. Assume the application is only using 1MB buffers: 100% of requests are for 1MB buffers. The target buffer count is 100% of size 1MB, which matches the current state. Nothing is freed, regardless of how much memory is allocated. Is my reading of XrdBuffManager::Reshape() correct?

@simonmichal simonmichal merged commit b7c4302 into xrootd:master Aug 24, 2017
@jthiltges jthiltges deleted the buffer-count branch September 7, 2017 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants