CopyDisable

Thursday, 20 January 2022

Bootstrapping your own Kubernetes clusters for testing and development

 In this document, I am going to show you the simplest & quickest way to ready your own Kubernetes cluster that you can use for testing, learning and development purposes. It is not recommended for production scenarios. 

I will use one master node and two worker nodes for this demonstration. I am using Virtualbox VMs with all the nodes running Ubuntu 20.04 and the scripts that I am going to use are also for Ubuntu only. 


Prerequisites:

  • Minimum RAM per node should be 2 GB

  • 2 CPU cores per node

  • Swap off on all the nodes

    • Run swapoff command on each node:
      $ sudo swapoff -a 

    • Disable any swap entry in /etc/fstab file


Recommendation:

  • The nodes should probably be in the same local subnet, they should be able to communicate with each other without any firewall.

  • If you are using VMs in some cloud provider, ensure that the VMs are in the same VCN and subnet. You can configure the security list/cloud firewall so that the VMs can interact with each other for all the ports needed in a Kubernetes cluster.


Initial Setup:

Suppose my VMs are named this way:


Node

IP

master

192.168.0.51

worker1

192.168.0.52

worker2

192.168.0.53


You can add the entries in all the VMs hosts file, so that they can communicate with each other by hostnames. So edit /etc/hosts file on each VM and add the following lines:

192.168.0.51 master

192.168.0.52 worker1

192.168.0.53 worker2


Now we are ready to start the installation



Master Node:

On the master node run the scripts step by step in the same order it is shown below:

Step 1:

 
Install container runtime containerd using the script:
https://github.com/pranabsharma/scripts/blob/master/kubernetes/installation/install_containerd.sh 

Download the script and run it
ubuntu@master:~$ ./install_containerd.sh


Step 2:

Install the kubectl, kubeadm and kubelet using the script:

https://github.com/pranabsharma/scripts/blob/master/kubernetes/installation/install_kubeTools.sh

Download the script and run it

ubuntu@master:~$ ./install_kubeTools.sh



Step 3: 

Download the below script and ONLY run on your master node:

https://github.com/pranabsharma/scripts/blob/master/kubernetes/installation/run_on_master.sh 


Download the script and run it

ubuntu@master:~$ ./run_on_master.sh


This script does the following tasks:

  • Run kubeadm to initialize a Kubernetes control-plane on the master node.

  • Deploy Wavenet CNI plugin to manage the kubernetes pod networking. 

  • Copy the kubeconfig file to the user's home directory location so that kubectl commands can be run without specifying the kubeconfig file.



Our master node and control-plane are ready. At this point we will get the following status of our cluster:


ubuntu@master:~$ kubectl get node

NAME     STATUS   ROLES                  AGE   VERSION

master   Ready    control-plane,master   50m   v1.23.2



ubuntu@master:~$ kubectl get pod -n kube-system

NAME                                             READY       STATUS    RESTARTS      AGE

coredns-64897985d-fvnhj              1/1             Running           0                     51m

coredns-64897985d-wq6z5           1/1             Running           0                     51m

etcd-master                                   1/1             Running           0                     51m

kube-apiserver-master                  1/1             Running           0                     51m

kube-controller-manager-master   1/1             Running           0                     51m

kube-proxy-hnk2z                         1/1             Running           0                     51m

kube-scheduler-master                 1/1             Running           0                     51m

weave-net-gjvqq                           2/2             Running           1 (50m ago)    51m





Worker Node


Installation steps on worker nodes are the same as the master, the only difference is that we are going to skip the Step3 of the master node (step3 is for setting up the control plane). Run the scripts as shown in Step1 and Step2:

Step 1:

 
Install container runtime containerd using the script:
https://github.com/pranabsharma/scripts/blob/master/kubernetes/installation/install_containerd.sh 

Download the script and run it
ubuntu@worker1:~$ ./install_containerd.sh


Step 2:

Install the kubectl, kubeadm and kubelet using the script:

https://github.com/pranabsharma/scripts/blob/master/kubernetes/installation/install_kubeTools.sh

Download the script and run it

ubuntu@worker1:~$ ./install_kubeTools.sh



Adding Worker Nodes to the cluster


At this point our required software and services for the Kubernetes cluster are ready. The final step is to add the worker nodes to the cluster. 


Step1: 


We are going to create a new token for the worker node to join the cluster.


Run the below command on master node:


ubuntu@master:~$ kubeadm token create --print-join-command


This command will output the command to join the cluster. The output will be something like this:

kubeadm join 192.168.0.51:6443 --token pk9v0f.o8valhztkblohsmu --discovery-token-ca-cert-hash sha256:9e046d3f15e49c7363ec7a762767b169a296d6af7150aad56d21d54399a2df6f


Copy the output, we will need it in the next step.


Step 2:


Run the copied output command on the worker nodes


ubuntu@worker1:~$ kubeadm join 192.168.0.51:6443 --token pk9v0f.o8valhztkblohsmu --discovery-token-ca-cert-hash sha256:9e046d3f15e49c7363ec7a762767b169a296d6af7150aad56d21d54399a2df6f



Immediately after running the above command on worker node, if we check the nodes in the cluster we may get the below output:


ubuntu@master:~$ kubectl get node

NAME      STATUS     ROLES                  AGE   VERSION

master        Ready      control-plane,master   54m       v1.23.2

worker1       NotReady       <none>                 39s       v1.23.2


After some time, the worker node will come into the ready state.


In the same way we can add the worker2 node also.


That’s it, and our kubernetes cluster is ready to rock!!! Super easy isn’t it?

Wednesday, 6 February 2019

MongoDB text search score calculation


Full text search is the ability to efficiently search strings within strings. It is similar to finding keyword in a large text. MongoDB uses a text index and the $text operator to perform text search.

In MongoDB text search assigns a score to each document that contains the search term in the indexed fields. This score determines the relevance of a document to a given search query.

When we have text index on more than one field, sometimes one field will be more important than the other. So we can specify the importance of a field by specifying weight.

For a text index, the weight of an indexed field denotes the significance of the field relative to the other indexed fields in terms of the text search score. The default weight for every indexed field is 1.

Using the example collection from MongoDB full text search documents, I created the stores collection. The sample data of the collection shown below:







Now I created a text index specifying weights:







In the created index
  •  name field has a weight of 10 and
  • description field has a weight of 5

So the match in the name field has 2 times (i.e. 10:5) the impact as a match in the description field.


So how the score is calculated for a document in search query?

As per MongoDB document
•       For each indexed field in the document, MongoDB multiplies the number of matches by the weight and sums the results.
•       Using this sum, MongoDB then calculates the score for the document.


To check the score, we can use the $meta operator:









When I saw the score associated with a document, I was really confused and curious to know how actually the score is calculated. But reading the above MongoDB score calculation points it was not clear.
I searched and found one answer in Google Group for mongodb-user (https://groups.google.com/forum/#!topic/mongodb-user/99t5WXmUUAg) which threw some light on the score calculation.
As per my understanding, I have arrived the following points for the score calculation:
In MongoDB we have a weight coefficient which adjusts the score, the code line from MongoDB source is:
•       double coeff = (0.5 * data.count / numTokens) + 0.5;
•       data.count -> number of matches
•       numTokens -> number of items we matched after stemming and removing stop words

score = coeff * weight
•       weight -> Weight for an indexed field, default 1


I will show two examples of score calculation.


Example 1:





Here we are searching for the word Burger and one document was found with score 7.5. Here the Burger word is present in the name field only.
•       Number of matches in the document: 1
•       Number of tokens: 2 (Burger, Buns), after stemming and removing stop words
•       Weight for name field: 10

coeff = (0.5 * data.count / numTokens) + 0.5
         = (0.5 * 1/2) + 0.5
         = 0.75
score = coeff * weight
           = 0.75 * 10
           = 7.5





Example 2:





Here we are searching for the word Samosa and one document was found with score 10.625. Here the Samosa word was present both in name as well as in description fields.
•       Match for name field:
–      Number of matches: 1
–      Number of tokens: 2 (Samosa, Tea), after stemming and removing stop words
–      Weight for name field: 10

coeff     = (0.5 * data.count / numTokens) + 0.5
                         = (0.5 * 1/2) + 0.5
 = 0.75
Score for name field  = coeff * weight
                                               = 0.75 * 10
                                               = 7.5

•       Match for description field:
–      Number of matches: 1
–      Number of tokens: 4 (Hot, Samosa, hot, tea), after stemming and removing stop words
–      Weight for description field: 5

coeff     = (0.5 * data.count / numTokens) + 0.5
                         = (0.5 * 1/4) + 0.5
 = 0.625
Score for description field = coeff * weight
                                                       = 0.625 * 5
                                                       = 3.125

Total score  = Score for name + Score for description
                    = 7.5 + 3.125
                    = 10.625

Tuesday, 20 November 2018

Nginx HTTP/2 openssl NPN issue

We wanted to make one of our website HTTP/2 enabled. The website was running on Ubuntu 14.04 server and on Nginx web server version 1.14.0 (Nginx added HTTP/2 support since version 1.9.5). We did all the necessary configurations of Nginx and we were ready to go. But when we checked the website from our most commonly used web-browser Google chrome and Firefox, it showed that the website’s contents were loaded with HTTP/1.1 not with HTTP/2 as we expected.



When we checked the access log of the website, we could see HTTP/1.1 request only which was really strange for us as we did all necessary Nginx configurations for HTTP/2. Then we verified the HTTP/2 support for the website using the online tool https://tools.keycdn.com/http2-test and this tool showed that our website supports HTTP/2.
After doing some web search, we came across a nice blog: https://www.nginx.com/blog/supporting-http2-google-chrome-users/ which explained what was going wrong, please go through it.
The main reason why our website was not opening in HTTP/2 on major browsers, because the vendors have stopped supporting the Next Protocol Negotiation (NPN) method for upgrading a connection to HTTP/2. Now most of the newer versions of web browsers support the new standard, Application Layer Protocol Negotiation (ALPN). So the operating system on which the web server is running must provide a version of OpenSSL that supports ALPN. OpenSSL 1.0.2 or later supports ALPN. We were using Ubuntu 14.04 and which has OpenSSL version 1.0.1f and this version do not support ALPN. Ubuntu 16.04 LTS has OpenSSL version 1.0.2g and this one supports ALPN. So we shifted the website to another server with Ubuntu OS with version 16.04 LTS and then configured HTTP/2 on Nginx and the website started opening in HTTP/2 in web browsers.



Saturday, 11 August 2018

HTTP2 Push benchmarking


To check the performance of HTTP2 push feature I used a very basic HTML page with some static content like images and to load some CSS and two heavy JavaScript files.
This HTML page will be served by Nginx webserver version 1.15.2 (since Nginx version 1.13.9, HTTP2 push is supported) on Ubuntu 16.04.

HTML file used for testing:

<!DOCTYPE html>
<html lang="en">
<head>
<title>My HTTP2 Test</title>
<script src="js/angular.js"></script>
<script src="js/jquery-latest.js"></script>
<link href="css/RatingStars.css" rel="stylesheet" type="text/css" />
<link href="css/speech.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/track.css" rel="stylesheet" type="text/css" />
<link href="css/speech1.css" rel="stylesheet" type="text/css" />
<link href="css/speech2.css" rel="stylesheet" type="text/css" />
<link href="css/speech3.css" rel="stylesheet" type="text/css" />
<link href="css/speech4.css" rel="stylesheet" type="text/css" />
<link href="css/speech5.css" rel="stylesheet" type="text/css" />
<link href="css/speech6.css" rel="stylesheet" type="text/css" />
<link href="css/speech7.css" rel="stylesheet" type="text/css" />
<link href="css/speech8.css" rel="stylesheet" type="text/css" />
<link href="css/speech9.css" rel="stylesheet" type="text/css" />
<link href="css/speech10.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div>
<h1>Images</h1>
<div><img src="images/1.jpg" /></div>
<div><img src="images/2.jpg" /></div>
<div><img src="images/3.jpg" /></div>
<div><img src="images/4.jpg" /></div>
<div><img src="images/5.jpg" /></div>
<div><img src="images/6.jpg" /></div>
<div><img src="images/7.jpg" /></div>
<div><img src="images/8.jpg" /></div>
<div><img src="images/9.jpg" /></div>
<div><img src="images/10.jpg" /></div>
</div>
</body>

Nginx configuration:

For simple static file testing I used the http2_push directive in Nginx configuration file.
Note: By default Nginx limits number of concurrent push requests in a connection to 10. As the number of objects that we will be pushing is more than 10 for this test, so I will be changing the http2_max_concurrent_pushes directive to some desired value. For this test I am setting this to say 50. Set this in the http section of the nginx config file
http2_max_concurrent_pushes 50;

Test Scenarios

I took four different scenarios for this benchmarking test
1. Webserver will serve the page over simple HTTP using protocol HTTP/1.1
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location /index.html {
try_files $uri $uri/ =404;
}
}
2. Webserver will serve the page over HTTPS using protocol HTTP/1.1
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/nginx/ssl/star_mkcl_org.crt;
ssl_certificate_key /etc/nginx/ssl/mkcl-org.key;
ssl_stapling on;
ssl_stapling_verify on;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location /index.html {
try_files $uri $uri/ =404;
}
}
3. Webserver will serve the page over HTTPS using protocol HTTP/2
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/nginx/ssl/star_mkcl_org.crt;
ssl_certificate_key /etc/nginx/ssl/mkcl-org.key;
ssl_stapling on;
ssl_stapling_verify on;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location /index.html {
try_files $uri $uri/ =404;
}
}
4. Webserver will serve the page using protocol HTTP2 with Push feature.
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/nginx/ssl/star_mkcl_org.crt;
ssl_certificate_key /etc/nginx/ssl/mkcl-org.key;
ssl_stapling on;
ssl_stapling_verify on;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location /index.html {
http2_push /css/RatingStars.css;
http2_push /css/speech.css;
http2_push /css/style.css;
http2_push /css/track.css;
http2_push /css/speech1.css;
http2_push /css/speech2.css;
http2_push /css/speech3.css;
http2_push /css/speech4.css;
http2_push /css/speech5.css;
http2_push /css/speech6.css;
http2_push /css/speech7.css;
http2_push /css/speech8.css;
http2_push /css/speech9.css;
http2_push /css/speech10.css;
http2_push /js/angular.js;
http2_push /js/jquery-latest.js;
http2_push /images/1.jpg;
http2_push /images/2.jpg;
http2_push /images/3.jpg;
http2_push /images/4.jpg;
http2_push /images/5.jpg;
http2_push /images/6.jpg;
http2_push /images/7.jpg;
http2_push /images/8.jpg;
http2_push /images/9.jpg;
http2_push /images/10.jpg;
try_files $uri $uri/ =404;
}
}
Tests over internet connections are not that reliable. As I found two same test results gave big variation for the same configuration (e.g. one test gave 32 second load time and another test gave 7 second load time for the same scenario using internet connection).
So I decided to run the tests in two different environments:
· Hosted the above HTML page in public server and run the page load tests from Google Chrome and WebPageTest.org
· Hosted the HTML file in virtualbox and run the tests using Google chrome. Here I can get stable and reliable network link between the browser and the webserver. To simulate over the internet scenario, I used the tool Wondershaper to limit the incoming and outgoing bandwidth of the virtualbox VM to 1024kbps.

Test results:

Test run on Public Server using WebPageTest.org tool:



I have selected the Test Location Ireland and Browser as Chrome for my tests.
HTTP2 with Push
I run this test for 7 times and got the below results:
Performance Results (Median Run)
Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexTimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 1)6.925s0.777s7.000s70006.925s283,325 KB7.144s293,326 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)7.032s0.882s7.100s7100> 7.077s7.032s283,325 KB7.241s293,326 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)6.857s0.697s6.900s6900> 6.898s6.857s283,325 KB7.053s293,326 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 3)7.077s0.848s7.100s7100> 7.122s7.077s283,325 KB7.279s293,326 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)6.900s0.751s7.000s7000> 6.945s6.900s283,325 KB7.089s293,326 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 1)7.223s0.753s7.200s7200> 7.275s7.223s283,325 KB7.421s293,326 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)7.049s0.762s7.100s7100> 7.098s7.049s283,325 KB7.258s293,326 KB$$$$$

Considering the Fully loaded time of the webpage, we will calculate the average time: 7.212
HTTP2 without PUSH
I run this test for 3 times and got the below results:

Performance Results (Median Run)
Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)7.119s0.740s7.100s7100> 7.168s7.119s283,327 KB7.326s293,329 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 1)7.172s0.739s7.200s7200> 7.224s7.172s283,327 KB7.384s293,329 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)7.118s0.702s7.200s7200> 7.166s7.118s283,327 KB7.315s293,329 KB$$$$$

Considering the Fully loaded time of the webpage, we will calculate the average time: 7.342
HTTPS without HTTP2
I run this test for 3 times and got the below results:
Performance Results (Median Run)
Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 3)7.170s0.720s7.200s7200> 7.217s7.170s283,327 KB7.385s293,329 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 1)7.196s0.801s7.200s7200> 7.251s7.196s283,327 KB7.407s293,329 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 3)7.143s0.722s7.200s7200> 7.187s7.143s283,327 KB7.342s293,329 KB$$$$$

Considering the Fully loaded time of the webpage, we will calculate the average time: 7.378
HTTP 1.1 without HTTPS
I run this test for 8 times and got the below results:
Performance Results (Median Run)
Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)8.409s0.442s3.800s38003.806s8.409s273,327 KB8.605s283,328 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)6.760s0.410s3.400s34133.365s6.760s273,327 KB6.963s283,328 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)6.567s0.428s4.100s41004.110s6.567s273,327 KB6.768s283,328 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 1)6.601s0.407s4.000s40003.963s6.601s273,327 KB6.796s283,328 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 1)9.671s0.416s6.700s67006.740s9.671s273,327 KB9.870s283,328 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 1)6.765s0.443s3.800s38003.806s6.765s273,327 KB6.969s283,328 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)10.586s0.421s5.000s50005.055s10.586s273,327 KB10.781s283,328 KB$$$$$


Document CompleteFully Loaded
Load TimeFirst ByteStart RenderSpeed IndexFirst Interactive (beta)TimeRequestsBytes InTimeRequestsBytes InCost
First View (Run 2)6.553s0.409s3.800s38003.761s6.553s273,327 KB6.765s283,328 KB$$$$$

Considering the Fully loaded time of the webpage, we will calculate the average time: 7.9395
Final result of WebPageTest.org tool:
Here I considered the Full page load time returned by the tool.
For each test scenarios, I run the tool minimum 3 times and maximum 8 times and calculated the average of the results that I got.
The results are:
ScenarioFully loaded time (secs)
HTTP1.1 without SSL7.9395
HTTP1.1 with SSL7.378
HTTP2.0 with SSL7.342
HTTP2.0 with SSL and Push7.212






Conclusion: From the above results that we got from the WebPageTest.org tool, we can see that HTTP2 with Push feature has speed advantage over others.

Test run on Public Server using Google Chrome browser and using the developer tool:

First I tried to run the tests over our broadband connections, as broadband connections are not that reliable and I started to get weird results because of network link fluctuations. So I decided to use mobile phone 4G network for this test.




· HTTP1.1 without SSL
· HTTP1.1 with SSL



· HTTP2.0 with SSL




· HTTP2.0 with SSL and Push
Test1
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.310.918.3610.79
HTTP1.1 with SSL283.332.1932.0632.07
HTTP2.0 with SSL283.317.0411.5617.31
HTTP2.0 with SSL and Push283.37.747.637.64
Test2
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.316.9016.7616.77
HTTP1.1 with SSL283.37.235.827.12
HTTP2.0 with SSL283.310.706.8510.60
HTTP2.0 with SSL and Push283.35.784.595.68
Test3
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.310.127.6410
HTTP1.1 with SSL283.310.3910.2510.26
HTTP2.0 with SSL283.37.255.657.16
HTTP2.0 with SSL and Push283.35.795.655.66
Test 4
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.37.427.027.31
HTTP1.1 with SSL283.310.3210.1810.19
HTTP2.0 with SSL283.39.156.439.03
HTTP2.0 with SSL and Push283.312.068.6911.96

Averaging the results of the above 4 tests and selecting the Finish, DOMContentLoaded and Load times, we get the following results:
Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL11.33759.94511.2175
HTTP1.1 with SSL15.032514.577514.91
HTTP2.0 with SSL11.0357.622511.025
HTTP2.0 with SSL and Push7.84256.647.735





Conclusion: Here also we can conclude that HTTP2 with Push feature has loaded the page faster than others.

Test run on webpage hosted on virtualbox VM and requests sent using Google chrome.

In ideal scenario, the network should be reliable to get the proper results for benchmarks. But this is hardly possible in public network over internet. So I tried to simulate the scenario, using a tool named Wondershaper in my Ubuntu virtualbox VM. With the help of this tool I was able to limit the incoming and outgoing bandwidth of the virtualbox VM to 1024kbps, which is close to what we get in normal slow internet connections.
Results:
Test1
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.330.9530.8930.91
HTTP1.1 with SSL283.330.2530.5030.51
HTTP2.0 with SSL283.330.5913.9230.59
HTTP2.0 with SSL and Push283.330.7015.8030.70
Test2
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.331.1531.1131.13
HTTP1.1 with SSL283.330.8931.1631.18
HTTP2.0 with SSL283.331.8416.6831.84
HTTP2.0 with SSL and Push283.330.5715.5230.58
Test3
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.330.7926.6230.75
HTTP1.1 with SSL283.330.8531.1831.19
HTTP2.0 with SSL283.330.9115.7130.92
HTTP2.0 with SSL and Push283.330.7215.9030.72
Test4
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.331.2731.1931.20
HTTP1.1 with SSL283.330.5130.7530.77
HTTP2.0 with SSL283.330.0330.2430.26
HTTP2.0 with SSL and Push283.331.2716.4131.28
Test5
RequestsData Transfer (MB)Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL283.330.9930.9630.97
HTTP1.1 with SSL283.331.3531.5531.58
HTTP2.0 with SSL283.330.6515.4130.65
HTTP2.0 with SSL and Push283.330.4415.3130.44

Averaging the results of the above 5 tests and selecting the Finish, DOMContentLoaded and Load times, we get the following results:
Finish (Secs)DOMContentLoaded (Secs)Load (Secs)
HTTP1.1 without SSL31.0330.15430.992
HTTP1.1 with SSL30.7731.02831.046
HTTP2.0 with SSL30.80418.39230.852
HTTP2.0 with SSL and Push30.7415.78830.744







Conclusion: Here also we can see that HTTP2 Push shown speed improvement over the all the others.

Final Conclusion:

From all the above three types of tests, we can see that HTTP2 Push clearly had improved page load time. Also it reduces the time the browser spends waiting on the network.