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

large api/map requests still result in "out of memory" messages #22

Open
chrisnatali opened this issue Feb 10, 2016 · 4 comments
Open

Comments

@chrisnatali
Copy link
Contributor

Either address or limit number of nodes/area.

@chrisnatali chrisnatali changed the title large requests still result in "out of memory" messages large api/map requests still result in "out of memory" messages Feb 10, 2016
chrisnatali referenced this issue Feb 23, 2016
Further restrict bounds, num nodes to reduce memory requirements
@chrisnatali
Copy link
Contributor Author

This appears to be the reason the server hung last time: https://community.nitrous.io/posts/stability-and-a-linux-oom-killer-bug

Doesn't address why we're running out of memory, but updating to kernel > 3.13 should prevent us from getting locked out of the machine.

@chrisnatali
Copy link
Contributor Author

Useful for watching resource usage of specific pids:

ps -ef | grep '\(map\)\|\(postgres\)' | awk 'BEGIN { ORS="," } {print $2}' | sed 's/,$//' > pids
htop -p `cat pids`

@chrisnatali
Copy link
Contributor Author

Did some load testing of selcolumbia/osm-gridmaps-cgimap:0.3 (bounds restricted to 1000 sq degrees) vs osm-gridmaps-cgimap:0.4 (bounds restricted to 100 sq degrees). Found the former maxing out at over 14G while the latter remained at about 3G under the same load.

From this, it appears that cgimap loads all tiles for the bounding box into memory and also places that into postgres. That's consistent with the load profile, but will confirm.

This doc on osm quad_tile impl will be helpful.

@chrisnatali
Copy link
Contributor Author

Helpful quick load test:

Put 20 http requests into a file

seq 20 | xargs -i echo "http://172.17.0.3/api/0.6/map?bbox=4.0,9.0,14.9,19.9" >> calls

Execute them in parallel

cat calls | xargs -i -P10 curl {} > /dev/null

Monitor docker container memory

while true; do 
    for f in `find /sys/fs/cgroup/memory/docker/* -type d`; do 
        cat $f/memory.usage_in_bytes 
    done 
    echo "---" 
    sleep 1 
done

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

No branches or pull requests

1 participant