• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Optimize Nginx TLS Record Size For HTTP/2 TLS (Ubuntu, CentOS)

By Abhishek Ghosh October 13, 2016 10:55 am Updated on October 13, 2016

Optimize Nginx TLS Record Size For HTTP/2 TLS (Ubuntu, CentOS)

Advertisement

Previously we published some guides on optimising HTTP/2. Here is How to Optimize Nginx TLS Record Size For HTTP/2 TLS in Ubuntu & CentOS For Better PageLoading Speed. Easy to Follow Guide By Anyone.
We are taking it granted that the user who is reading is using Nginx either on CentOS from CentminMod build or using Ubuntu’s nginx-extras.

 

What You Exactly Say While Talking To Optimize Nginx TLS Record Size?

 

We promise that we will not deliver theory on TCP or TLS. We are talking around ssl_buffer_size size directive of Nginx configuration.

On the Internet data are transmitted using a multilayer protocol stack. We are interested in the area of TCP and TLS. TCP reliably deliver packets in the original order. If we have a service like HTTPS, then all encrypted TLS data will be sent via TCP. At the level of TCP, upon whitelisting a connection, the server may send no more than 3 packets for the old and 10 initcwnd packets. Then the server will wait for an acknowledgment from the client. Nginx uses a special buffer (which is indicated by the directive ssl_buffer_size), which controls the size of the TLS record. The browser can use the data only after receiving a complete TLS record. The maximum default size in Nginx of that ssl_buffer_size is 16k. Taking the opportunity of 10, this can cause minute delay in obtaining useful content.

Advertisement

---

Some associates HTTP/2 with ALPN with tweaking the directive http2_chunk_size. By default it is 8k. That is not exactly correct. But obviously, end result as TTFB will get affected.

optimize-nginx-tls-record-size-for-http-2-tls

 

Optimize Nginx TLS Record Size For HTTP/2 TLS (Ubuntu, CentOS)

 

Cloudflare has patch for supporting dynamic record sizing with Nginx, obviously it is useful if you are compiling Nginx from source. That is easiest in case of using CentminMod :

Vim
1
https://github.com/cloudflare/sslconfig/tree/master/patches

nginx-extras package do support change of Nginx TLS Record Size aka ssl_buffer_size size as default function. Cloudflare patch adds the dynamic function. You can actually control it.

ssl_dyn_rec_size_lo indicates what TLS record size to start with which defaults to 1369 bytes. ssl_dyn_rec_size_hi indicates what TLS record size will grow to which defaults to 4229 bytes.
ssl_dyn_rec_threshold is the number of records to be send before changing the record size. ssl_dyn_rec_timeout dynamically reduces the size to ssl_dyn_rec_size_lo if there is idling. If this value is 0 then dynamic TLS record sizes are disabled and the fixed ssl_buffer_size will be used. There is no way of tuning of the ssl_dyn_rec settings. To enable with default settings, you would (may) need to set the following directive ssl_dyn_rec_enable on;. Nginx hardcodes 16KB size in ngx_event_openssl but with nginx-extras, you can actually adjust ssl_buffer_size. It is directly related to processor, hence cipher :

Vim
1
2
http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_buffer_size
https://software.intel.com/en-us/articles/improving-openssl-performance

When using OpenSSL 1.0.2 or higher, it is possible to specify multiple curves (1.11.0), for example:

Vim
1
ssl_ecdh_curve prime256v1:secp384r1;

We will suggest you to test with :

Vim
1
ssl_buffer_size 4k;

When ssl_buffer_size set to lower than default 16k value i.e. ssl_buffer_size is set to 1400 bytes, first byte should load just faster. ssl_buffer_size 6 to 8k is more than enough to ensure a minimum TTFB in most cases.

For different devices and also test higher value like :

Vim
1
ssl_buffer_size 64k;

We think, this much is enough for most of the common users.

 

How To Test and Optimize Nginx TLS Record Size?

 

Wireshark is a network protocol analyser which can be difficult to use by an ordinary user. We will suggest to allow some time (for cache) after change and test on WebPageTest. Obviously, this website as example never depends on ONLY this website’s domain and server. Time to First Byte of 60 ms to 80 ms is acceptable. Obviously if we load a plain text on this domain, it will load within a second! Actually PageSpeed Insights is overall practical. You are running to optimize Nginx TLS record size but your CSS is blocking – that is not acceptable.

Tagged With http2_chunk_size , nginx database optimize ttfb , nginx ssl buffer size http2 , nginx tls dynamic record size , optimize nginx ssl , paperuri:(2099935beaeb22e2fc49159d763faca0) , ssl_buffer_size 64k downloads

This Article Has Been Shared 968 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Optimize Nginx TLS Record Size For HTTP/2 TLS (Ubuntu, CentOS)

  • How to Upload Backup to Dropbox from Cloud Server

    Here is How to Upload Backup to Dropbox from Cloud Server in Case You Want To Keep Your Backup of Files and Database on a Free Cloud Storage.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • Steps To Install Nginx Plus on Ubuntu Server (HP Cloud)

    Here Are the Steps To Install Nginx Plus on Ubuntu Server Running on HP Cloud. Nginx Plus is the Paid Version of Nginx with Extra Features.

  • Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2

    Here Are Steps For Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2 With Troubleshooting Error. Nginx Has No Support For this Upgrade.

  • Upgrade Ubuntu Server 14.04 to 16.04 With Live WordPress

    Here Are the Detailed Steps on How To Upgrade Ubuntu Server 14.04 to 16.04 With Live WordPress With Kernel Upgrade, Debug & Fixes For Nginx.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Optimize Nginx TLS Record Size For HTTP/2 TLS (Ubuntu, CentOS)," in The Customize Windows, October 13, 2016, January 28, 2023, https://thecustomizewindows.com/2016/10/optimize-nginx-tls-record-size-http2-tls-ubuntu-centos/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT