Running out of Disk Space in Production
47 points by romes
47 points by romes
It's funny (sad) that I've used nginx for so long I kind of guessed the punchline.
Anyway, It might help to also look at using X-Accel-Redirect to let nginx directly serve the static content as well. Backend can do whatever authorization necessary then internally redirect to an nginx endpoint that serves it.
https://github.com/nginxinc/nginx-wiki/blob/master/source/start/topics/examples/x-accel.rst
Several places I have worked used nginx as a reverse proxy, then encountered problems due to its default settings.
The most common problem I've seen is the small default size limit on POST requests, meaning file uploads only work for small files. Either nobody integration tests the application alongside the reverse proxy, or integration testing uses small files that avoid the problem.
It's well worth reading nginx's configuration documentation to make sure its defaults make sense for you. Ideally, test your full application, including supporting tools that you didn't write like nginx, in a production-like environment, with requests similar to those you encounter in production.
Public facing Web servers need to handle all sorts of unusual or malicious requests. nginx's defaults make sense in this context, as long as nobody treats nginx as something that "just works" without careful configuration.
Good and informative article. I think we have all been there looking at the quickest option to save space/memory/connections and totally missing the root cause somewhere else.
Would you consider an S3-equivalent option for storing the card files to avoid handling this kind of issue yourself in the future?
Great article. I also run Plausible and I found that if you leave ClickHouse to its defaults, it does a lot of unnecessary disk IO, which in long term reduces the disk life. If you don't care about the advanced features of ClickHouse, it makes sense to tune it to reduce IO.