• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


nginx performance tuning

Nginx worker Process & worker connections explained Events module‌

worker_processes auto;

events {
use epoll;
worker_connections 1024;
multi_accept on;
}

worker process = auto means

Equal to number of CPU cores available in the machine.

you can manually adjust it if you need lower usage of cpu. in multi application environment like docker.

 

Worker connections Default 512

or 1024

in 2 core machine 2 worker process.

each worker process handles  1024*2 = 2048 connections / per seconds (1000+ live visitors).

 

enough cpu power then increase worker connection per seconds.

Bottleneck file descriptors limit in linux kernel

nginx multi_accept on |off;

 

default value off, accepts one connection at a time, with on accepts all connection at once, useful in traffic with scarifying cpu power.

mutex on | off;

mutual exclusion) to open the listening sockets

 

thread_pool

apache: process use memory, process switch uses cpu,

nginx: asynchronous, event‑driven approach has a problem

blocking:  then thread pool introduced nginx 1.17.

instead of processing task by thread it will put in pool so another free thread can do this,  threads requires resources.

to enable include aio threads directive

 

worker_cpu_affinity 

default off (not recommended for multi core cpus and cpus with hyperthreading)

worker_priority default 0

-20 to hgh

kernel process at -5

worker_rlimit_core 

default none

Defines the size of core files per worker process.

worker_rlimit_nofile

number of files that a worker process may use simultaneously.

worker_aio_requests

maximum number of outstanding asynchronous I/O operations for a single worker process, if we use epoll connection.

worker_aio_requests 10000;

epoll: An efficient method for Linux 2.6+ based operating systems.

Disable access_logs if don’t use

access_log off;

 

also read nginx error log & frequent errors

 

Buffers

timeouts

Sizes

proxy (php -fpm , apache as a proxy to nginx)

compression

ssl tuning

you must read nginx conf explained here.

 

$request_time – from client to client
$upstream_connect_time – upstream connection
$upstream_header_time – connection + firstbyte
$upstream_response_time – connection +last byte

 

access_log /var/log/nginx/access.log

114.119.163.217 – – [31/Jul/2020:06:25:21 +0000] “GET /health/daily-nutritional-requirement/amp HTTP/1.1” 301 5 “-” “Mozilla/5.0 (Linux; Android 7.0;) AppleWebKit/537.36 (KHTML, like Gecko) Mobile Safari/537.36 (compatible; PetalBot;+https://aspiegel.com/petalbot)”

access_log /var/log/nginx/access.log timed_combined;

114.119.163.217 – – [31/Jul/2020:06:25:21 +0000] “GET /health/daily-nutritional-requirement/amp HTTP/1.1” 301 5 “-” “Mozilla/5.0 (Linux; Android 7.0;) AppleWebKit/537.36 (KHTML, like Gecko) Mobile Safari/537.36 (compatible; PetalBot;+https://aspiegel.com/petalbot)” 0.640 0.640 .

0.640 secs google bot

 

FIle descriptors in  /etc/security/limits.conf

sys.fs.file-max – The system‑wide limit
nofile – user limit

ulimit -Hn  (hard limit we cannot increase more than this unless kernel config)

ulimit -Sn (sof limit we can increase upto hard limit)

root@instance-1:~# cat /proc/sys/fs/file-max

398155

root@instance-1:~# ulimit -Sn

1024

root@instance-1:~# ulimit -Hn

1048576

 

Connection Queue by Linux at etc/sysctl.conf

net.core.somaxconn

maximum number of connection queued for nginx. (default 512 nginx accepts very fast but required in traffic spike)

nginx stub status module.

net.core.netdev_max_backlog

rate at which packets are buffered by the network card before being handed off to the CPU

 

connection ques at operating system before nginx can process

512 to 65536

fs.file-max

nano /etc/sysctl.conf

TCP optimization

buffers

timeouts

net.core.somaxconn = 65535  //Max connections

net.core.netdev_max_backlog = 65535 //incoming connections backlog

 

 

Related topics:

  1. increase open file limit linux File descriptor ft nginx , mysql, lemp
  2. linux performance tuning inode limit file descriptors tco, kernel etc
  3. apache performance tuning mpm-worker vs prefork vs event modules
  4. nginx conf explained best config file performance tuning tips nginx.conf location errors tutorial
  5. PHP performance tuning nginx php-fpm conf pool manger dynamic vs static vs on demand

tutorials

  • Vivek Bindra Videos Transcription (business strategy)
  • git commands
  • new relic php agent install in 3 steps
  • new relic mysql install integration - 2 ways fix problems
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
    • Top 10 tips to improve nginx server security
    • upgrade php fpm ubuntu nginx 7.4 to 8.2
    • install phpmyadmin ubuntu nginx 22.04
    • php fpm install ubuntu 20.04 nginx
    • nginx upstream response is buffered to a temporary file
    • php fpm ondemand vs dynamic vs Static (the dynamic pool problem)
    • Php fpm configuration for 1000 concurrent connections server busy max children reached
    • php fpm seems busy fixed warning and max children reached to handle max connections / requests
    • newrelic nginx integration process and errors fix and metrics
    • datadog nginx integration installation process
    • nginx rate limiting explained by location time specific url
    • SSL faster reduce TLS hand shake improve https performance
    • monitor nginx request with nginx status amplify datadog new relic
    • nginx installation on ubuntu 20.04 LTS
    • enable brotli compression nginx brotli vs gzip
    • nginx performance tuning
    • Letsencrypt SSL Installation on apache/Nginx ubuntu / debian wordpress
    • letsencrypt install configure on ubuntu / debian nginx
    • what is TTFB & how to Reduce it (server response time) Google pagespeed
    • php fpm restart nginx ubuntu enable status page, monitor etc
    • php fpm pool manager configuration settings based on server spike high cpu wordpress
    • nginx modules list (enable, disable, upgrade, install dynamic module)
    • nginx rewrite rules with examples 301 redirection
    • use nginx as reverse proxy and load balancer for apache wordpress
    • nginx conf explained best config file performance tuning tips nginx.conf location errors tutorial
    • nginx errors (504,502, 413, unable to start, syntax errors)
    • Pagespeed module install, configure, monitor, errors ft nginx &apache
    • Apache vs nginx (connection handling, modules, memory usage)
    • install LEMP Stack on 22.04 LTS Nginx MySQL PHP fpm #wordpress #digital ocean
    • nginx fastcgi cache wordpress how to configure
    • fix error 520 522 524 on cloudflare wordpress godaddy nginx etc
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy