openchargemap/ocm-system

API down/slow

Closed this issue · 6 comments

We're getting timeouts on the API currently. It works intermittently with lag, but usually times out. Known issue? What can we do about it. Thanks.

Hi, thanks for raising this. Performing server reboot now. Our API is currently running at 100% uptime but has slowed in response time over the last 24hrs, will investigate - it's probably a caching issue.

As a follow up - I am seeing a problem on the server with high CPU, it's a combination of a problem with our MongoDB based caching database which sometimes starts using a lot of CPU for no obvious reason (requiring re-creation of the db) and automated server OS updates which also take a while to complete, combined with fairly high general usage of the API.

As mentioned elsewhere there is ongoing work to provide read-only versions of the API that others can host (see #148) and I intend to start using at least one of these clones to start serving API reads by default. Behind the scenes the plan is to use a cloudflare worker to decide if requests should be served by a read-only clone or by the master API (read/write). This raises the overall latency and response time in some cases but has the advantage that the read-only clones are cheap to run and quite fast (~300ms response times). This is still a work in progress but is quite urgent.

Ok this is mostly resolved but people can start testing out the load balanced API using:

http://api-router.openchargemap.io/

e.g. https://api-router.openchargemap.io/v3/poi

Eventually this will also be the handler for api.openchargemap.io

Hi, we tried the new URL, but we get back CloudFlare errors.

@stanvass sorry missed you reply. The api-router service is now in beta (being used by map.openchargemap.io) but will eventually this will just be api.openchargemap.io - this works using cloudflare workers to decide which back-end (primary api and one or more mirrors) to route requests to based on type.

Also note that Webprofusion Pty Ltd (my company) is now offering hosted & managed APIs commercially - these will have an SLA for avg response time and availability and are available as monthly or annual subscription (from $199 USD monthly, depending on requirements). Most people will still use the free API but some users may require a commercial level of service.