Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Revisiting pre-encoded headers#584

Closed
JunTaoLuo wants to merge 1 commit intodevfrom
johluo/new-preencoded-headers
Closed

Revisiting pre-encoded headers#584
JunTaoLuo wants to merge 1 commit intodevfrom
johluo/new-preencoded-headers

Conversation

@JunTaoLuo
Copy link
Contributor

Continuing from #491

@Tratcher
Copy link
Member

@halter73?

@halter73
Copy link
Member

@JunTaoLuo told me it only made about a 1% improvement in /plaintext benchmark. He's testing again with more headers. If it doesn't make that much of a difference, I think we just close this to keep things simpler.

@JunTaoLuo
Copy link
Contributor Author

Here are the results I'm getting from benchmarks:

I tried the plaintext benchmarks with the headers I get from going to github.com:

Cache-Control:no-cache
Content-Encoding:gzip
Content-Security-Policy:default-src *; base-uri 'self'; connect-src 'self' live.github.com wss://live.github.com uploads.github.com status.github.com api.github.com www.google-analytics.com api.braintreegateway.com client-analytics.braintreegateway.com github-cloud.s3.amazonaws.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-src 'self' render.githubusercontent.com gist.github.com checkout.paypal.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com checkout.paypal.com collector.githubapp.com *.githubusercontent.com *.gravatar.com *.wp.com; media-src 'none'; object-src assets-cdn.github.com; script-src assets-cdn.github.com; style-src 'self' 'unsafe-inline' 'unsafe-eval' assets-cdn.github.com
Content-Type:text/plain
Date:Thu, 21 Jan 2016 20:26:04 GMT
Public-Key-Pins:max-age=300; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="JbQbUG5JMJUoI6brnx0x3vZF6jilxsapbXGVfjhN8Fg="; includeSubDomains
Server:GitHub.com
Strict-Transport-Security:max-age=31536000; includeSubdomains; preload
Vary:X-PJAX
Vary:Accept-Encoding
X-Content-Type-Options:nosniff
X-Frame-Options:deny
X-GitHub-Request-Id:836BA04A:0179:274B1A9:56A13ED6
X-Request-Id:e52c4a78ec4cfadb14262168197dd21f
X-Runtime:0.011955
X-Served-By:53e13e5d66f560f3e2b04e74a099de0d
X-UA-Compatible:IE=Edge,chrome=1
X-XSS-Protection:1; mode=block

Using pre-encoded headers after about 10 runs:

Median-ish (just eyeballing):
Running 10s test @ http://10.0.0.100:5001/plaintext
32 threads and 256 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.60ms 12.98ms 229.48ms 96.00%
Req/Sec 16.44k 1.60k 33.29k 77.12%
5268480 requests in 10.09s, 7.51GB read
Requests/sec: 522015.96
Transfer/sec: 761.68MB

Worst:
Running 10s test @ http://10.0.0.100:5001/plaintext
32 threads and 256 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.48ms 11.11ms 220.26ms 95.86%
Req/Sec 16.15k 1.68k 34.24k 70.72%
5174797 requests in 10.08s, 7.37GB read
Requests/sec: 513315.02

Best:
Running 10s test @ http://10.0.0.100:5001/plaintext
32 threads and 256 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.82ms 13.18ms 186.46ms 94.99%
Req/Sec 16.92k 1.65k 26.18k 70.80%
5432570 requests in 10.10s, 7.74GB read
Requests/sec: 538024.98
Transfer/sec: 785.04MB

Not pre-encoding after about 10 runs:

Median-ish (just eyeballing):
Running 10s test @ http://10.0.0.100:5001/plaintext
32 threads and 256 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.43ms 9.50ms 257.14ms 94.64%
Req/Sec 15.54k 1.54k 41.19k 78.03%
4978647 requests in 10.07s, 7.09GB read
Requests/sec: 497220.61
Transfer/sec: 721.13MB

Worst:
Running 10s test @ http://10.0.0.100:5001/plaintext
32 threads and 256 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 5.72ms 6.69ms 132.28ms 94.59%
Req/Sec 15.51k 1.85k 55.43k 85.23%
4972067 requests in 10.10s, 7.08GB read
Requests/sec: 492403.45
Transfer/sec: 718.48MB

Best:
Running 10s test @ http://10.0.0.100:5001/plaintext
32 threads and 256 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.19ms 9.65ms 189.36ms 95.00%
Req/Sec 15.90k 1.46k 39.37k 75.38%
5094835 requests in 10.08s, 7.26GB read
Requests/sec: 505287.69
Transfer/sec: 737.28MB

This yields about 4-7% improvement when using pre-encoded headers.

@JunTaoLuo
Copy link
Contributor Author

After speaking with @halter73 we decided that the minor improvement here isn't valuable ~1% improvement for the plaintext benchmark and ~4-7% when there are many headers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants