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

Can we reduce redis commands [from the editor]? #3943

Closed
rochoa opened this issue Jun 5, 2015 · 6 comments · Fixed by #4301
Closed

Can we reduce redis commands [from the editor]? #3943

rochoa opened this issue Jun 5, 2015 · 6 comments · Fixed by #4301

Comments

@rochoa
Copy link
Contributor

rochoa commented Jun 5, 2015

In development environment with SQL API, Maps API and Rails app running (resque was stopped) I started redis-cli monitor and tracked the number of commands.

I got:

cut -d ' ' -f 4 | sort | uniq -c | sort -nr
780 "ZSCORE"
  26 "get"
  10 "del"
   6 "select"
   6 "info"
   4 "unwatch"
   4 "hmget"
   4 "hget"
   2 "HMSET"
   1 "hset"

ZSCORE commands are requesting things like "ZSCORE" "user:development:mapviews_es:stat_tag:3d5ce24a-c907-11e4-b2fc-6476ba93d4f6" "20150507". Do we need that somewhere in the editor for the map?

@luisbosque
Copy link
Contributor

That query is probably run by the visualizations list view because it needs the last 30 days of map views in order to draw a small graphic in the visualization preview.

/cc @xavijam

@xavijam
Copy link
Contributor

xavijam commented Jun 15, 2015

yep

@rochoa
Copy link
Contributor Author

rochoa commented Jun 15, 2015

Sorry if I didn't explain myself really well, I meant went you open a Map in the editor view, like in:

screen shot 2015-06-15 at 16 47 58

@luisbosque luisbosque added this to the Los Navalmorales milestone Jun 16, 2015
@rochoa rochoa assigned javisantana and unassigned luisbosque Jul 2, 2015
@rochoa
Copy link
Contributor Author

rochoa commented Jul 2, 2015

@javisantana I'm reassigning to you so you can decide who can handle it.

@javisantana
Copy link
Contributor

the problem is, everytime we load Visualization model the extended stats (*) are fetch from redis, that launch 60 ZSCORE commands.

The proposal is not load extended stats on public pages (since they are not needed) and doing it in /api/v2/vis endpoints.

In a second phase we will add a flag in /api/v2/vis so frontend can request or not the extended stats.

The extended stats could be also cached for some time since it's not that important to know minute by minute the visualization count per day.

(*) there are 2 kind of stats:

@juanignaciosl
Copy link
Contributor

Team maps page is also very slow, probably because of this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants