layout: post title: ‘grafana speedup’ tags: ubuntu 18.04 16.04 hw2018 server apache grafana xdeprecated permalink: apache-gzip-grafana-faster-v0.html —

This post is outdated, see update here.

grafana uses the json data format to transfer data to the browser. While json is easy to work with, it is really bandwidth inefficient. This may not be a problem on a local fast network, but I use grafana through a 10 Mbit/s internet access, so it can be painfully slow.

But http traffic can be compressed , and apache obviously support that.

apache configuration


Here are some numbers for displaying 1 year of data, over my light-speed 10 MBit/s connection:

Test condition Uncompressed data size Uncompressed duration Compressed size Compressed duration Gain
browser cache disabled 50.5 MB 52 s 5.2 MB 11 s 4.7x faster
browser cache active (second load) 45.5 MB 41 s 3.8 MB 5 s 8.2x faster

On the local network, the same page loads in ±4 seconds, with or without cache and with or without compression.

Compression comes at the cost of an increase in CPU load and local access may be a little bit slower (on simpler pages), but this is the price to pay to run 8.2x faster remotely.