Bobcares

NGINX Keepalive_Timeout | A Simple Guide

by | Aug 15, 2023

Read the article to know more about the keepalive_timeout in NGINX. Bobcares, as a part of our Server Management Service offers solutions to every query that comes our way.

More on keepalive_timeout in NGINX

The Nginx configuration file’s keepalive_timeout setting describes how long the server must wait before receiving requests from a client. Another way to put it is that it represents the duration for which an idle keepalive connection will remain active. For between six and ten seconds, it is advisable to leave the idle connection open.

The server will be overburdened and RAM resources will be squandered if the keepalive_timeout setting is set too high. The syntax is as follows:

keepalive_timeout [time]

For instance, if we set the time to 10 seconds, it will look like:

keepalive_timeout 10;

We’ll look into the main components of the function:

1. Keep-Alive Connection: The NGINX server can decide whether to maintain the connection after providing the response when a client (such as a browser) sends a request. Avoiding the time-consuming process of creating a new connection for every request will also enable the client to reuse the same connection for subsequent requests.

2. Idle Timeout: The keepalive_timeout directive determines the longest period of inactivity for a persistent connection. NGINX will kill the connection to free up server resources if no requests are delivered across it during this time.

3. Syntax: We can set up the directive in server blocks or the nginx.conf configuration file for NGINX.

The value of keepalive_timeout must be balanced. Also, setting it too high would result in lots of unused connections, which would use up server resources. Setting it too low might lead to more connections being opened for each request, which would increase overhead.

When setting the keepalive_timeout value, we must take into account the features of the application and the anticipated client usage patterns. A greater value can be appropriate if the application handles numerous requests from the same client in a short amount of time. On the other hand, a smaller amount can be preferable if we have many clients making infrequent requests.

Always test and track the effect of the keepalive_timeout parameter on the performance of the NGINX server to discover the ideal setting for the particular use.

[Looking for a solution to another query? We’re available 24/7.]

Conclusion

With the keepalive_timeout in NGINX, we can decide how long the server must wait before receiving requests from a client.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF