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

Does anyone use http2?

http2 protocol with https allegedly provides performance gains in addition to security. Many platforms require substantial upgrades to make it work. Has anyone done it? Do you think the benefits are worthwhile?

Re: Does anyone use http2?

Reply #1

I use it, but just because is already set up by serverpilot configuration, I really don't know if brings any vantage  :-[
sorry for my bad english

Re: Does anyone use http2?

Reply #2

I think it's mostly worthwhile for sites that would otherwise be stupid slow (think your Twitters, Facebooks, and other 2MB+ behemoths) but even on proper websites the benefits are indeed not negligible. See, e.g., https://www.troyhunt.com/i-wanna-go-fast-https-massive-speed-advantage/

Re: Does anyone use http2?

Reply #3

Radu is http2 now also part of the basic package in DO that u have sugested me [1]

from what I read, its must have, when running a forum is in question 

https://http2.akamai.com/

is this means that on serverpilot with http2 as default protocol i'll get same speed as on digitaloceans 2cpu package

Re: Does anyone use http2?

Reply #4

Quote from: badmonkey – http2 protocol with https allegedly provides performance gains in addition to security. Many platforms require substantial upgrades to make it work. Has anyone done it? Do you think the benefits are worthwhile?
I am using since end of last year. Since you are on your own server I'd say, go for it. It has been so far so good to me.

Quote from: omBre – Radu is http2 now also part of the basic package in DO that u have sugested me [1]

from what I read, its must have, when running a forum is in question 

https://http2.akamai.com/

is this means that on serverpilot with http2 as default protocol i'll get same speed as on digitaloceans 2cpu package
I think you need to add that up yourself.


Re: Does anyone use http2?

Reply #6

Not much to implement it. It's available in Nginx.

Re: Does anyone use http2?

Reply #7

Thanks for the thoughts guys. It is a done deal. It wasn't horrible to implement, but not exactly easy either. The variable is OS. On a Centos 6 machine a few upgrades must be made.

Nginx supports out of the box since XXX version. But it had to be compiled for C6, which ships with openssl 1.0.1e, therefore so was nginx. So it's compile a modern openssl version. Well...a few dependencies are missing. The guides I found didn't cover them. So a shotgun approach was in order. Finally got openssl compiled. Then it was compile nginx. A few hiccups later got that done. Configure http2 and off to the races.

Many publications fail to mention all that. Lol. Performance is killer too. Totally worth it.

Re: Does anyone use http2?

Reply #8

Quote from: Joshua Dickerson – Not much to implement it. It's available in Nginx.

as noob in the forum administration, from those listed in the link the cdn Incapsula seems ok as security option along the oportunity to workout for me the http2 protocol ... maybe if I had some minimal seo knowledge this would be unnecessary ...

Re: Does anyone use http2?

Reply #9

Glad you solve it @badmonkey;)
Cannot talk about performances and differences, since I had it installed since the first day I switched to a vps.
sorry for my bad english

Re: Does anyone use http2?

Reply #10

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.

At least with Ubuntu I can use latest updated and stable version via various ppa's in an easy way without compiling things myself.[1]

By the way, since you are compiling your own custom nginx, do check brotli. It is claimed that it is far more better than gzip. I don't have a good ppa to use, so I will wait, but you can definitely try it.
I know about the good and bad of ppa but nothing is actually perfect and I can live with it. :D

Re: Does anyone use http2?

Reply #11

Thanks for the brotli tip. I've looked it over but never thought about using it in nginx. Hhmmm.... 8)


On a tangent that's actually a nice thing about compiling your own. There can be a custom setup in minutes!

Re: Does anyone use http2?

Reply #12

And if you don't mind, do share your code for compiling your custom nginx (just the nginx part). May be I'll try playing it sometimes.  ;)

Re: Does anyone use http2?

Reply #13

It's something like this, with a contingency plan at the end should something go wrong.  ;)


So you will have a configuration backup, just in case.

Code: [Select]
cp -R /etc/nginx /etc/nginx_bak

A local backup isn't a terrible idea either. 


Be sure to find your openssl version, and replace the version in the configure command below. Use this to find your version (must be 1.0.2 or greater for http2 support)
Code: [Select]
openssl version



Code: [Select]
mkdir /home/projects
cd /home/projects
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar zxf nginx-1.13.7.tar.gz
cd nginx-1.13.7


 ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-openssl=/usr/src/openssl-1.0.2a --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC'

make


cd /usr/sbin
cp nginx nginx.dist
cp /home/projects/nginx-1.13.7/objs/nginx /usr/sbin/nginx.custom
service nginx stop ; rm /usr/sbin/nginx ; ln -s nginx.custom nginx ; service nginx start


Woops!!!!! I need to go back to a working version for a production environment!!
service nginx stop ; rm /usr/sbin/nginx ; ln -s nginx.dist nginx ; service nginx start


You're probably noticing there is a newer nginx version, 1.13.8. That version is super slow with the geoip module.  Should be fine if you aren't using it.  Should you forget to add a module or wish to recompile for whatever reason, a

Code: [Select]
make clean


is recommended prior to the ./configure command.  ;)

Re: Does anyone use http2?

Reply #14

@ahrasis‍ do you think brotli will make a significant difference over gzip for dynamic content?  Some suggest it's greatest benefit is serving static content.  Still, you've piqued my curiosity.... :D


Also, how would you (or anyone else here) feel about the nginx pagespeed module? Which would be better for overall performance? Or both?