-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 a mmap file to read data in StaticRoute #517
Conversation
I think it's overoptimization. |
I'm sure there are countless schemes of serving up static content using other software, but I was strictly thinking from aiohttp's point of view rather than aiohttp + x. But sendfile is useless in my case because I'm serving everything over SSL. I know I can do SSL termination at the load balancer, but I'd rather have each app do it's own crypto. I'll do some benchmarks tonight to see if using |
SSL use case makes sense for PR, I've missed this. |
@jashandeep-sohi unfortunately GitHub doesn't send notification email if you just push new commits without a comment. Do you think the current stage is ready for review? |
Well, I was trying to running some benchmarks yesterday with As for this PR, the code is good, but I haven't profiled memory usage yet. |
Consider reviewing & merging. |
Please fix merge conflicts |
fixed |
Use a mmap file to read data in StaticRoute
Thanks |
When making use of the fallback sendfile method, a
mmap
file should be used to read the data to reduce memory usage.Correct me if I'm wrong, but I believe reading data from a
mmap
file is better if you are running a web app on multiple processes. With ammap
file each process can share the memory pages, and thus save you some memory. This probably only true for large files.