Kibana load times

Hi guys,
Just wanted to verify that I'm not missing anything, and this behaviour is normal.

For me, it takes about 8 seconds until Kibana's main page load.
Is there anything to do about that?
It's hosted on the cloud.elatic.co, and running on an Azure E32sV3.

I'm talking about that page, which has very little to render

Other than that, Kibana instance monitoring looks like that:

I wish I was at 8 seconds! I'm at anywhere from 30-200 seconds on the cloud.co hosted Kibana.

The problem is that the distribution of Kibana is setup badly if you have any kind of latency. Every asset is served with "Cache-Control: must-revalidate", just revalidating the 150 or so assets with a 300ms ping takes 30 seconds (and there's something where a bunch of scripts are loaded serially). You can't even stick a cdn in front of it effectively because the cdn would have to revalidate too.

The solution is to setup a reverse proxy and overwrite Cache-Control with something useful. Finally put cloudflare/cloudfront as a CDN in front of it and you should get to 2-3 seconds. You might have a problem where upgrading Kibana results in some stale assets being served for a period (but it's easier to deal with that every few months than enduring the loading spinner multiple times per day).

My nginx config (hosting under /kibana using oauth2_proxy) is:

    # override cache-control header for cacheable assets on kibana.
    # we can't do any complex conditions with nginx so we just look for etag as a
    # sign it's cacheable and leaving the no-cache queries alone.
    map $sent_http_etag $kibana_cache_control {
      default "";
      ~.+  public,max-age=240000;
    }



    # manifest.json is served without the oauth2 cooke so we need to disable auth.
    location /kibana/ui/favicons/manifest.json {
      auth_request off;
      proxy_pass http://kibana:5601/ui/favicons/manifest.json;
      proxy_http_version 1.1;
      proxy_request_buffering off;
      proxy_set_header Authorization "Basic .....";
    }


    location /kibana/ {
      proxy_pass http://kibana:5601/;
      proxy_http_version 1.1;
      proxy_request_buffering off;

      proxy_set_header   X-Real-IP $remote_addr;
      proxy_set_header   Host      $host;
      proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
      proxy_set_header   X-Forwarded-Proto $scheme;
      proxy_set_header   X-Forwarded-Host $host;

      proxy_hide_header "Cache-Control";
      add_header "Cache-Control" $kibana_cache_control;

      proxy_set_header Authorization "Basic ........";
    }
1 Like

Thanks a lot @Krister !
Did you configure anything on cloud deployment side? ( kibana> user settings)

You would need to run an nginx and kibana instance locally, or somewhere on your infrastructure. Your local Kibana talks to the cloud hosted Elastic instance but you basically avoid the cloud hosted Kibana.

Thanks @Krister ,so it's not possible to use a proxy in the cloud? I thought you have configured a reverse proxy while hosting Kibana on the cloud

You could reverse proxy to the cloud as well. But you can't adjust server.basePath in the cloud so your reverse proxy would not be under a sub-directory and will have to be an entire virtual host (with ssl setup etc).

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.