-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Provide Alpine Docker image #867
Comments
Thanks for putting that together. Can you try making some API requests to it and leaving it running for a while? Last time we experimented with Alpine we ran into a GHC memory leak that appears to be related to that platform. |
@mcarans it's not about leaving it for a while, you need to send a lot of requests to PostgREST to use up some memory so that GC has something to clean up. You need to generate like upwords of 1M requests in a short time frame (5-10min). Watch the memory used at the beginning, see it grow during the test. If it the end, the memory usage goes down to the initial level, you are fine but i think it will stay up (this is what i saw when i did this test in the past, didn't feel like tracking this down since alpine is not an officially supported platform of GHC, and the bug seems to be a very low level) |
Ok maybe you can make an Alpine Postgrest image available (or point to mine as an unofficial one) with a warning that millions of requests per minute has been known to cause a memory leak (as Alpine is not a supported platform for GHC) so people can choose to use it or not given the warning. So far Postgrest on Alpine has been up since 20 April but there are few requests going to it. |
the problem does not appear ONLY when you have a big rps number. The problem is that used memory does not get cleaned up at any volume. whatever your load, eventually your server is going to run out of memory and crash. The 1m number was just a way for you to flash out the bug in a short timespan (5min). Unless this is fixed i would not suggest to anyone to use alpine with postgrest in any setting. This is a fundamental bug that can have weird manifestations so i would not want ppl submitting bugs like "postgrest crashed/uses a lot of memory" and finding out 2 days into debuging that he is using an alpine image |
Ok fair enough. I will let you know how things go with leaving my Postgrest running. Do you recall what Alpine and GHC versions you tested before? The image I created is for Alpine 3.4, GHC 7.10. GHC is in Alpine testing now: alpinelinux/aports#205 |
@mcarans Any news? |
It seems to be stable for me - no issues - but then it is not receiving that many requests, certainly not the millions per minute necessary to surface the bug. |
@mcarans Could you please provide an up to date Dockerfile thats using ghc from testing? |
Replace XXX above appropriately. Note that I wanted to use one of our org's base images and so was restricted to a non-current version of Alpine (3.4), hence the checkout of a specific commit, the last to support the Alpine version. Also it is here: https://hub.docker.com/r/mcarans/alpine-haskell-postgrest/ |
we now have an automated release script. you could add a PR to build the alpine specific binary and docker. |
@mcarans a PR would be welcomed. |
It would be good to have an Alpine Docker image. I have created one here:
https://hub.docker.com/r/mcarans/alpine-haskell-postgrest/ which uses the last version of Postgrest that worked with Alpine 3.4.
(Git commit hash: 726b2b9)
It can be used in docker-compose.yml like this:
rest:
image: mcarans/alpine-haskell-postgrest
ports:
- "3000:3000"
environment:
- DB_URL=${DB_URL}
- DB_USER=${DB_USER}
command: ["sh", "/root/runpostgrest.sh"]
logging:
driver: "json-file"
options:
max-size: "100k"
max-file: "1"
The text was updated successfully, but these errors were encountered: