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

Date histogram slow on Discover page #15732

Closed
bczifra opened this issue Dec 21, 2017 · 6 comments
Closed

Date histogram slow on Discover page #15732

bczifra opened this issue Dec 21, 2017 · 6 comments
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement

Comments

@bczifra
Copy link
Member

bczifra commented Dec 21, 2017

Describe the feature:
When loading the discover page, the date histogram can take a long time to load, especially if a large time frame is selected. Looking at the requests submitted by Kibana, this seems to be due principally to the time_zone property included in that calculation. The request is dramatically faster when dropping that property, which is apparently normal behavior. It would be nice if the histogram could be loaded in batches and not delay the loading of the documents in the discover pane, or if applying the time_zone property would be optional

@timroes timroes added :Discovery Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement labels Dec 21, 2017
@jgough
Copy link

jgough commented Dec 21, 2017

This sounds similar to the issue I filed in #15662

@Bargs
Copy link
Contributor

Bargs commented Mar 7, 2018

Turns out this might be solvable in ES.

@sergii-sakharov
Copy link

Was probably introduced by
#13378

@Bargs
Copy link
Contributor

Bargs commented Mar 27, 2018

Nope, that PR only changed TSVB which we don’t use in Discover.

@sergii-sakharov
Copy link

sergii-sakharov commented Apr 30, 2018

After some testing - difference only starts being noticeable on datasets ( shards? ) of more than 10mil documents. Affected areas include discover and any visualizations that use datetime histograms.
So far 2 workarounds discovered:

  1. Change timezone in Kibana settings to a fixed offset one (will only be acceptable if all users are in the same timezone e.g. no offshore teams or no expectations)
  2. Introduce a proxy layer between Elasticsearch and Kibana and modify requests sent by Kibana. E.g. here's our nginx config:
location / {

-- rest of the proxy config

      lua_need_request_body on;

      rewrite_by_lua_block {
        if ngx.req.get_method() = "POST"
          ngx.req.read_body()
          local data = ngx.req.get_body_data()
          if data then
            data = string.gsub(data, '(%\"time_zone%\"%s*:%s*")Europe/London(%\")', "%1UTC%2")
            ngx.req.set_body_data(data)
          end
        end
 }

Note: in our case the difference is dramatic (2+ times faster discover and visualizations with datetime histograms) so for us workaround is worth it.

@timroes
Copy link
Contributor

timroes commented May 6, 2018

Since this problem does not only persist on the Discover screen but for all date histograms, I opened the meta issue #18853 for it with a detailed explanation and what we can and what and why we can't do some solutions.

I will close this issue in favor or #18853

@timroes timroes closed this as completed May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement
Projects
None yet
Development

No branches or pull requests

5 participants