impactoss/impactoss-server

Improve server performance, specifically API requests

Opened this issue · 11 comments

some requests take 12s

2017-08-16T04:53:47.239591+00:00 heroku[router]: at=info method=GET path="/measures" host=undp-sadata-staging.herokuapp.com request_id=8b30a393-77b4-4f79-b16f-5d1a62e01b68 fwd="210.246.55.14" dyno=web.1 connect=0ms service=12698ms status=200 bytes=369010 protocol=https

May also be related to #264?

While individual requests for our "larger" tables (eg measures, 250 rows) take "only" ~2.5s, when requesting multiple tables concurrently the same table may take ~12s

Production site with "Standard 0" DB plan
image

Staging site with "Hobby Dev" DB plan
image

While the download time appears reasonable , I wonder @barancw if and how we can reduce the waiting time?

improve waiting times on production

@barancw should we merge yesterday's updates into master?

@barancw have merged recent changes from production into master. While there appears to be some performance gain (requests no longer exceed 30s when they time out), still measures table takes 20s to load
image

@barancw should default_scope { includes(:versions) } be also added to other models (currently added for recommendations and categories only)?

@barancw have added default_scope { includes(:versions) } to other models 316a4a4

This gives significant performance gain (~half). Still API request times are not acceptable so we will need to investigate