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

How to run open-elevation to support 50,000 queries at a time #59

Open
kovar-ursa opened this issue Feb 11, 2022 · 2 comments
Open

How to run open-elevation to support 50,000 queries at a time #59

kovar-ursa opened this issue Feb 11, 2022 · 2 comments

Comments

@kovar-ursa
Copy link

Putting this here as an issue as it should help others with the same question.

Change config.ini to:

port=8080 # Unless you want to run as root and can bind to 80
# How many GeoTIFF files to keep in memory for caching and request speeding up
open-interfaces-size=12
# Number of gunicorn workers
workers=8

Change server.py, right after "from gdal_interfaces"

import bottle
bottle.BaseRequest.MEMFILE_MAX = 1000 * bottle.BaseRequest.MEMFILE_MAX

Then run it with:

python server.py

It may be possible to tweak the config.ini better but those values work for me to support 50,000+ queries per call running locally.

If someone wants to build a new docker instance, that'd be great.

@vrzh
Copy link

vrzh commented Mar 11, 2022

Thanks for this. I was also getting the "Invalid JSON" error message and your fix of increasing bottle.BaseRequest.MEMFILE_MAX fixed it for me.

@aliasfoxkde
Copy link

Very cool but I think you might be bottlenecked by the API through web here. Alternatively, I took only the raw "gdal_interfaces.py" and stripped down the server.py file to get additional performance. But you can just import it directly into python directly "from server import *" and you can make about 50K queries per second (depending on hardware I imagine). I'm using a hybrid of the Web API and direct access myself.

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

3 participants