-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add volume for nginx cache #1511
Add volume for nginx cache #1511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
I think sentry-nginx-cache
is a more appropriate name for this volume and will reduce the effort later if we wanted to have another volume for a different part of our nginx
.
Out of curiosity, is there a reason not to mount the entire /var/cache/nginx
instead of only client_temp
folder, even though it will not give us any value right now, it may do in future and also it's more suitable for our naming :)
My concern was that with
|
e7e858c
to
d4a12ed
Compare
Changed to add volume for whole |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to use tmpfs
for this then: https://docs.docker.com/compose/compose-file/compose-file-v3/#tmpfs
not this is for cases when |
@glensc But we can use |
@aminvakil client_body_buffer_size has everything to do with this. it's what the related issue is for: the disk will be used for requests larger than client_body_buffer_size, if you want to keep data in memory you increase that value. setting nginx to write to disk but then hacking kernel to use tmpfs seems odd approach if you can just change the client_body_buffer_size setting. if the request is smaller than the buffer it's not written to disk at all but kept in memory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @glensc has a good point there. Since the speed of tmpfs
comes from it being based on the memory, using that here doesn't make much sense. Based on that I think this patch is good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from being tmpfs
or not, this is definitely an improvement.
@glensc Thanks!
Use volume for writable data, as it's supposedly faster because no need to update overlayfs layers on volumes.
NOTE:
nginx
itself doeschown nginx
on startup according to my tests:Refs:
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.