graylog-labs / graylog2-web-interface

[DEPRECATED]
https://www.graylog.org/
611 stars 174 forks source link

HTTP compression could help graylog-web a lot #1723

Closed jhaar closed 8 years ago

jhaar commented 8 years ago

Hi there

We've got a graylog-(web|server) instance on the East coast USA and I'm in New Zealand (ie a loooong way away). One thing that grates is that when I'm running a search, the web results state that it took (say) 90ms to do the search, but the webpage took 8+ sec to load...

Looking at the main search output page that comes back in Firebug, it took 6sec and was over 680Kb in size (ie no wonder it took 6sec to get to my browser). The majority of content is the text from the records being returned, but it is all cleartext - ie no sign of HTTP compression being used? Given the repetitive nature of searches and the data returned, compressing the data in transit could immensely speed up web surfing. I just saved the primary output page and gzip'ed it - it went from 700K to 38K - only 5% of the original filesize...

I'm running graylog behind Apache as a reverse proxy, so I reconfigured Apache to support "SetOutputFilter DEFLATE" - ie Apache is talking over a few metres to the non-compressing graylog web service, and my browser is talking over continents via a compressed stream from Apache. Looking MUCH better now: that 6-8sec just became 1.3sec

I think if graylog-web natively supported HTTP compression, it would immensely improve the performance over WANs/Internet - without needing to do any real work?

PS: of course this is just the obvious one. It looks like the Flash application is explicitly uncachable - there's a tonne of "200" http codes being reported without much sign of "304" http codes - perhaps there are some other cheap wins possible?

Thanks

Jason

jhaar commented 8 years ago

FYI, I find YSlow for Chrome a brilliant add-on for discovering how optimized a website is: it can give you feedback about compression, placement of CSS and javascript - all sorts of things

kroepke commented 8 years ago

The web interface in 2.0 is a single page app, largely in Javascript. It loads static (cacheable) assets to run the UI and after that only uses the REST API on port 12900 which supports gzip compression already.

We believe this issue will go away in 2.0. An alpha release will be available in the next few days and we are greatly interested in getting feedback.

Thanks for the suggestion!

joschi commented 8 years ago

In the current development line (Graylog 2.0.0), it's possible to enable gzip compression via the web_enable_gzip configuration setting (https://github.com/Graylog2/graylog2-server/blob/2.0.0-alpha.1/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/BaseConfiguration.java#L135-L136).

In the 1.3 branch, it's now possible to enable gzip compression via the graylog2.gzip-filter configuration setting (see 8d4ae1bd2bdb13d2ed920e626352b304b3c47933).