cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

rleir
17-Peridot

HTTP/2

Hi All

Have you experimented with HTTP/2? I suspect that the TWX Composer would load faster in the browser, because there are so many JavaScript modules, particularly if the server is not local. The Runtime might load faster too. Have you timed this by any chance? It is an easy test if you have access to the server, just put HAproxy in front of Tomcat (and Apache?). Or reconfigure Tomcat (and Apache?). Then open Chrome Inspect Network tab and reload.

Thanks -- Rick

1 ACCEPTED SOLUTION

Accepted Solutions

Hello Rick,

 

TL/DR; It doesn't make any noticeable difference in terms of speed or subjective user experience.

 

I've just tried it -- our application "dashboard" mashup loads on average within 5.25s with HTTP/1.1 and 5.27 with HTTP/2 (average over 10 executions). The same with the Composer, which in my case loads within 3.10 seconds, with <5% random difference between two protocols.

 

To test it I have two nginx running side-by-side on different ports. The only difference is "http2" bit in the config:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
	server {
		listen 443 ssl http2;
		server_name localhost;

		ssl_certificate     ../cert/localhost.crt;
		ssl_certificate_key ../cert/localhost.key;
		ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
		ssl_ciphers         HIGH:!aNULL:!MD5;
 		
		location /Thingworx {
			proxy_pass                  http://127.0.0.1:8080/Thingworx;
			proxy_http_version      1.1;
		}
	} 
}

Note that you have to use SSL/TLS, otherwise it won't work. I use the latest version of Chrome and measure performance using Chrome DevTools. ThingWorx 8.5.3-b123 on localhost.

 

I'm attaching the screenshot which demonstrates the difference between the two, where it's easy to see how HTTP/2 multiplexes requests. Thanks to HTTP headers compression HTTP/2 saves 3KB on 472KB download for Composer, so less than 1% saving in terms of traffic.

 

Regards,
Constantine

View solution in original post

3 REPLIES 3

Hello Rick,

 

TL/DR; It doesn't make any noticeable difference in terms of speed or subjective user experience.

 

I've just tried it -- our application "dashboard" mashup loads on average within 5.25s with HTTP/1.1 and 5.27 with HTTP/2 (average over 10 executions). The same with the Composer, which in my case loads within 3.10 seconds, with <5% random difference between two protocols.

 

To test it I have two nginx running side-by-side on different ports. The only difference is "http2" bit in the config:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
	server {
		listen 443 ssl http2;
		server_name localhost;

		ssl_certificate     ../cert/localhost.crt;
		ssl_certificate_key ../cert/localhost.key;
		ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
		ssl_ciphers         HIGH:!aNULL:!MD5;
 		
		location /Thingworx {
			proxy_pass                  http://127.0.0.1:8080/Thingworx;
			proxy_http_version      1.1;
		}
	} 
}

Note that you have to use SSL/TLS, otherwise it won't work. I use the latest version of Chrome and measure performance using Chrome DevTools. ThingWorx 8.5.3-b123 on localhost.

 

I'm attaching the screenshot which demonstrates the difference between the two, where it's easy to see how HTTP/2 multiplexes requests. Thanks to HTTP headers compression HTTP/2 saves 3KB on 472KB download for Composer, so less than 1% saving in terms of traffic.

 

Regards,
Constantine

FWIW disabling TLS doesn't make it any faster either.

rleir
17-Peridot
(To:Constantine)

Your server is on localhost. Having a remote server makes a difference, according to the Manning book.

thanks -- Rick

Top Tags