HTTP 1.1 vs HTTP 2.0 Performance Comparison on API Service

I’ve had a complex requirement on current project, that is moving all my API services from HTTP 1.1 to HTTP 2.0. Based on the several articles online that i found after googling, it seems that HTTP 2.0 is much faster compared to HTTP 1.1, but that metrics shows browser based request only. Doesnt exactly represent my current condition, which is a native mobile application firing HTTP API request.

So in order to measure performance of both HTTP version, i install two instance of Apache Tomcat 9.0M22 which provides HTTP 1.1 and HTTP 2.0, and create a simple test unit using curl to fetch an image which located on both instance.

Here is the curl that i used to fetch image using HTTP 1.1

curl -I http://128.199.177.158:8080/Sweet-Bites,-Greentea-Brownies-with-Cashew-Ovomaltine-banner1.png

And here is curl for HTTP 2.0

curl -I --http2 https://128.199.177.158:8443/Sweet-Bites,-Greentea-Brownies-with-Cashew-Ovomaltine-banner1.png -k

Fire my unit test for 500 times, and measure the result. Here is the complete graphic

image002

It seems that for fetching a plain image, HTTP 1.1 took less time compared to HTTP 2.0. Perhaps due to my HTTP 1.1 requests are using an insecure connection, while HTTP 2.0 enforcing an SSL connection.

Feel free to look at my code here,


https://github.com/edwin/http2test

It seems that for my case, HTTP 2.0 not yielding a better performance compared to HTTP 1.1. So i guess i’ll stick with HTTP 1.1 for a while.

Google+

No Comments

Leave a Comment

Please be polite. We appreciate that.
Your email address will not be published and required fields are marked


:-[ (B) (^) (P) (@) (O) (D) :-S ;-( (C) (&) :-$ (E) (~) (K) (I) (L) (8) :-O (T) (G) (F) :-( (H) :-) (*) :-D (N) (Y) :-P (U) (W) ;-)