Skip to main content
Topic: Does anyone use http2? (Read 7405 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Does anyone use http2?

Reply #15

Well that was interesting.  Using this compression tool:

http://www.visiospark.com/gzip-compression-test/



Here are the results with gzip level 6:

Original Size:51.3 KB
Gzipped / Compressed Size:9.3 KB
Compression Percentage:81.87% of page is compressed
Status Code:200
Request Time:1.03636s
Compression Time:0.00184607505798s
Content Type:text/html; charset=UTF-8
And brotli level 6:
Original Size:51.8 KB
Gzipped / Compressed Size:9.6 KB
Compression Percentage:81.47% of page is compressed
Status Code:200
Request Time:0.98672s
Compression Time:0.00286102294922s
Content Type:text/html; charset=UTF-8
Yes, those are in the correct order.  Huh.  

Re: Does anyone use http2?

Reply #16

Reducing the compression level to 4 did yield a faster compression time than gzip with a slightly better compression. In the interest of full disclosure, these were one-time tests. They're hardly scientific but do demonstrate possible capabilities. 

Original Size:51.4 KB
Gzipped / Compressed Size:9.3 KB
Compression Percentage:81.91% of page is compressed
Status Code:200
Request Time:0.98454s
Compression Time:0.00139307975769s
Content Type:text/html; charset=UTF-8
In all honesty I think a forum with a handful of tiny images is too small in rendered page size to benefit from brotli over gzip.  But hey, it was fun trying.  ;D  Clearly they're both better than no compression!!  

Re: Does anyone use http2?

Reply #17

Well I haven't tried it yet so I didn't know. From what I read, brotli do not compressed a compressed file and compressing a compressed file like png will only create a bigger file than original. And from claims, they do work better on statics but I can't be sure how it works or will it work.

How did you set your nginx.conf for brotli anyway?

Re: Does anyone use http2?

Reply #18

Here is the conf. Also in the interest of full disclosure, gzip settings are included.   ;)



Code: [Select]
      ##
        # Gzip Settings
        ##

        gzip on;
        gzip_static on;
        gzip_min_length 2048;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_comp_level 6;
        gzip_proxied any;
        gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js image/gif image/jpeg image/jpg;
        gzip_buffers 16 32k;
       
        #broccoli settings
    brotli on;
    brotli_comp_level 4;
    brotli_buffers 16 8k;
    brotli_min_length 2048;
    brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
    brotli_types *;

Re: Does anyone use http2?

Reply #19

Quote from: ahrasis – Congrats @badmonkey. That's why I never continue with Centos (and original Debian) though I'd prefer it if I have more time to master them. They never have easy-to-use repo for most of the latest thing.
I enabled HTTP2 on my Debian Stretch VPN no problem two days ago after posting my earlier message in this thread. ;)

My private FreshRSS instance actually seems to load minutely faster, though I'm not sure if it's a placebo effect. Besides the first load it should be all cached anyway, after all.

Re: Does anyone use http2?

Reply #20

Oh yes. Debian Stretch should have http2 by default in its supported nginx version. But I am not so sure about brotli.

By the way, @badmonkey this "brotli_types *;" is what I was talking about compression on compressed files via brotli module. Try to take that out.

Re: Does anyone use http2?

Reply #21

Ah yes, missed that.  Thanks.  Here are the results:


URL:https://bbs.zuwharrie.com
Original Size:51.2 KB
Gzipped / Compressed Size:9.3 KB
Compression Percentage:81.84% of page is compressed
Status Code:200
Request Time:1.22118s
Compression Time:0.00371408462524s
Content Type:text/html; charset=UTF-8

Re: Does anyone use http2?

Reply #22

Kinda of not much of a change or to compare with gzip or may be gzip shouldn't be on to test it. Ok, I am not sure the right way on how to implement it as all readings only mention it as per your settings. Sorry @badmonkey. May be once I tried I can figure it out.

Re: Does anyone use http2?

Reply #23

Nothing to be sorry about. We are learning things. That's time well spent. ;)   That said, I may disable it in the short term, as the page does feel slightly more sluggish. We can continue researching configuration while applying periodic tests. It's only a couple commands away!

I'm already wondering if config order matters....

Re: Does anyone use http2?

Reply #24

Quote from: ahrasis – Oh yes. Debian Stretch should have http2 by default in its supported nginx version. But I am not so sure about brotli.
Oh, actually I use Apache. :D But the older Debian would've also required compiling Apache yourself for that.

I've played around with Nginx as well, but I didn't really see a reason to switch. I suppose for non-private use at scale speed might become an issue.

Also, of course you could always consider running your Nginx (or whatever) in a Docker container so you don't have to bother compiling things yourself. I haven't investigated if there's a sensible way to do things like auto-updating (for security) in that case, however.

Re: Does anyone use http2?

Reply #25

More messing around.  Here is a result using brotli level 1.  

Original Size:51.3 KB
Gzipped / Compressed Size:9.3 KB
Compression Percentage:81.87% of page is compressed
Status Code:200
Request Time:0.984s
Compression Time:0.00141096115112s
Content Type:text/html; charset=UTF-8

Re: Does anyone use http2?

Reply #26

And gzip level 1.


Original Size:51.4 KB
Gzipped / Compressed Size:9.4 KB
Compression Percentage:81.71% of page is compressed
Status Code:200
Request Time:1.15723s
Compression Time:0.00146794319153s
Content Type:text/html; charset=UTF-8
At least in one instance level 1 gzip actually provided ever so slightly better compression than level 6.  Lowering brotli compression level decreased compression time.  Albeit not a great reduction in the numbers themselves, perceived snappiness of the page is certainly better.  Decompression time plays into that as well.  That said, I'm not seeing a reason to run either compression method greater than level 1 for on the fly (streaming) compression, nor am I seeing a huge difference in performance at that level. The edge may indeed belong to brotli!

Re: Does anyone use http2?

Reply #27

I have updated my nginx and install brotli and its module but I haven't set brotli in my nginx.conf yet. Still figuring the right way to do it.

Re: Does anyone use http2?

Reply #28

Your page was 0.00005698204s faster and 0.1KB smaller due to brotli. They are the same.

Re: Does anyone use http2?

Reply #29

Quote from: Joshua Dickerson – Your page was 0.00005698204s faster and 0.1KB smaller due to brotli. They are the same.


On a busy server, savings are savings.  Even if fractional.  lol!


There are no claims that brotli IS the winner, only that it MAY be a winner with proper use and configuration.  Streaming compression is not it's intended strong suit.  Here, it's demonstrated it can actually hold it's own with streaming gzip compression.  Frankly, that was unexpected.  An interesting comparison would involve static file compression to take full advantage of brotli's intended use.  I have no datapoints to make those comparisons, but speculate if brotli's documentation is even remotely correct it "may" grab a lead over gzip.  Likewise, until or unless we have said datapoints, we cannot say they are the same, either.