question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP2 performance on client side

See original GitHub issue

Background:

We are trying to adopt Netty based http2(SSL) to our project. The use case is: a router connects many data nodes and send/receive requests. The router is a Netty http2 based client and data nodes are netty http2 based servers.

The initial implementation is done.

We did a performance test which sent GET requests to all data nodes from the router. The GET request size is 100Bytes and response size is 1MB. QPS is 100. I looked at our internal metrics and noticed that data nodes performance are good, but router performance is terrible(P95 latency > 1k ms, same datacenter). The huge latency mainly comes from stream send-to-response time(start from frame’s writeAndFlush() to response arrived in our stream channel handler). CPU and memory usage are low: around 10%. Network bandwidth is good. Buffer size: 1MB.

We tried to use EpollEventLoopGroup and tune number of connections to each data node, but get almost same result.

Does anyone has similar http2 client performance experience? Is there any netty metric I can look at? I am particularly interested in the stream round trip time(from request leaves netty to response comes back).

Any help will be appreciated.

Expected behavior

Latency under 200ms.

Actual behavior

Latency > 1K ms.

Steps to reproduce

not easy.

Minimal yet complete reproducer code (or URL to code)

Netty version

4.1.42.Final

JVM version (e.g. java -version)

java version “1.8.0_121”

OS version (e.g. uname -a)

Linux 3.10.0-957.12.2.el7.x86_64 #1 SMP Fri Apr 19 21:09:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13

github_iconTop GitHub Comments

2reactions
zzmaocommented, Apr 28, 2020

@ninja- Get some numbers just now!

I changed maxFrameSize, window size, Netty recv buffer and OS TCP max_rmem to 1MB. These change reduced GET P95 latency to 30ms from 1000ms+!

With these changes, CPU usage go up to 35% from 5%.

0reactions
ninja-commented, Apr 30, 2020

YourKit profiler maybe if that’s what you are asking

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP/2 vs. HTTP/1.1: How do they affect web performance?
Learn how HTTP 1.1 slows web performance. Compare HTTP/2 vs. HTTP/1.1, learn why HTTP/2 is faster, and learn about the next HTTP version:...
Read more >
Introduction to HTTP/2 - web.dev
HTTP/2 (or h2) is a binary protocol that brings push, multiplexing streams and frame control to the web.
Read more >
Performance testing HTTP/1.1 vs HTTP/2 vs HTTP/2 + Server ...
HTTP/2 is now widely available. In HTTP/2 the cost of HTTP requests is significantly lower. Whereas with HTTP/1.1 it was required to open...
Read more >
HTTP/2 vs HTTP/1 - Performance Comparison? - ImageKit.io
HTTP/2 gives you a great performance boost. And you should be using it right now.
Read more >
HTTP/2 Performance Guide - USWDS - Digital.gov
HTTP/2 changes how resources affect a page's download speed and how resources are downloaded from the server to the browser. Some performance improvement ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found