← Back
nginx

How we solved a CPU bottleneck caused by Lua exceptions in a custom Kong plugin (using OpenResty XRay)

  • The problem: high CPU usage in Kong servers
  • The analysis & report
  • The result: improved performance and reduced CPU usage
Photo by Yichun Zhang
  • The problem: high CPU usage in Kong servers
  • The analysis & report
  • The result: improved performance and reduced CPU usage

Memory and CPU usage statistics among Kong plugins online (using OpenResty XRay)

  • CPU usage among all Kong plugins in a server process
  • Memory usage among all Kong plugins in a server process
  • Extra overhead for the servers
Photo by Yichun Zhang
  • CPU usage among all Kong plugins in a server process
  • Memory usage among all Kong plugins in a server process
  • Extra overhead for the servers

Troubleshooting the extra 200-ms request latency online

  • The Problem
  • The Analsysis Process
  • Fully-automated analysis
  • What is OpenResty XRay
Photo by Yichun Zhang
  • The Problem
  • The Analsysis Process
  • Fully-automated analysis
  • What is OpenResty XRay

Real-Time Request Counting against Nginx Processes via YSQL

  • How to install the run-ysql tool
  • Count total requests served in real time
  • Filter out specific requests
  • Using YSQL in the Web Console
  • True non-invasive tracing
Photo by Yichun Zhang
  • How to install the run-ysql tool
  • Count total requests served in real time
  • Filter out specific requests
  • Using YSQL in the Web Console
  • True non-invasive tracing

When Lua IPC Pipes Block OpenResty or Nginx's Event Loops

  • The Problem
  • Analyses
  • Solutions
  • Results
Photo by Yichun Zhang
  • The Problem
  • Analyses
  • Solutions
  • Results

Optimize Memory Fragmentation due to Huge Nginx Configuration

  • Challenges
  • Analyses
  • Solutions
  • Results
Photo by Yichun Zhang
  • Challenges
  • Analyses
  • Solutions
  • Results

Tracing the Slowest PCRE Regular Expressions in OpenResty or Nginx Processes

  • System Environment
  • Narrowing Down the Culprit without Guessing
  • Limiting the execution overhead of PCRE
  • Non-Backtracking Regular Expression Engines
  • Lua’s Builtin Patterns
  • Tracing Applications inside Containers
  • How The Tools are Implemented
  • The Overhead of the Tools
  • System Environment
  • Narrowing Down the Culprit without Guessing
  • Limiting the execution overhead of PCRE
  • Non-Backtracking Regular Expression Engines
  • Lua’s Builtin Patterns
  • Tracing Applications inside Containers
  • How The Tools are Implemented
  • The Overhead of the Tools

Listing Loaded Lua Modules in OpenResty or Nginx Processes

  • System Environment
  • Names of Loaded Lua Modules
  • Running Directly in the Web Console
  • Tracing Applications inside Containers
  • How The Tools are Implemented
  • The Overhead of the Tools
Photo by Yichun Zhang
  • System Environment
  • Names of Loaded Lua Modules
  • Running Directly in the Web Console
  • Tracing Applications inside Containers
  • How The Tools are Implemented
  • The Overhead of the Tools

Analyzing the Most CPU-Consuming Requests in OpenResty or Nginx

  • System Environment
  • CPU-Hottest Request Hostnames
  • CPU-Hottest Request URIs
  • Digging Deeper
  • Running Directly in the Web Console
  • Tracing Applications inside Containers
  • How The Tools are Implemented
  • The Overhead of the Tools
Photo by Yichun Zhang
  • System Environment
  • CPU-Hottest Request Hostnames
  • CPU-Hottest Request URIs
  • Digging Deeper
  • Running Directly in the Web Console
  • Tracing Applications inside Containers
  • How The Tools are Implemented
  • The Overhead of the Tools

Install OpenResty on Ubuntu 20.04 via apt-get

Photo by Ubuntu

Streaming HTTP Response Output in OpenResty

Photo by Michal Matlon

Precompile Lua Modules into LuaJIT Bytecode to Speedup OpenResty Startup

Photo by Yichun Zhang

Timing Lua Code Correctly in OpenResty

Photo by Andrik Langfield

Lookup OpenResty Documentation on Terminal with restydoc

Photo by Cristina Gottardi

Share Data Across Requests Served by OpenResty

Photo by Gautam Ganguly

Install OpenResty on CentOS 8 via dnf

Photo by Yichun Zhang

The resty Command-Line Utility Demo

Photo by Markus Spiske & Yichun Zhang

Write Your Own Lua Modules for OpenResty Applications

Photo by Gerry Roarty

Hello World HTTP Example in OpenResty

Photo by 2Photo Pots

Introduction to Lua-Land CPU Flame Graphs

  • What is a Flame Graph
  • Simple Lua samples
  • Complicated Lua applications
  • Sampling overhead
  • Safety
  • Compatibility
  • Other types of Lua-land Flame Graphs
Photo by Guido Jansen
  • What is a Flame Graph
  • Simple Lua samples
  • Complicated Lua applications
  • Sampling overhead
  • Safety
  • Compatibility
  • Other types of Lua-land Flame Graphs

Memory Fragmentation in OpenResty and Nginx's Shared Memory Zones

  • An empty zone
  • Filling entries of similar sizes
  • Deleting odd-numbered keys
  • Deleting the keys in the first half
  • Mitigating Fragmentation
Photo by Elena Mozhvilo
  • An empty zone
  • Filling entries of similar sizes
  • Deleting odd-numbered keys
  • Deleting the keys in the first half
  • Mitigating Fragmentation

How OpenResty and Nginx Shared Memory Zones Consume RAM

  • Slabs and pages
  • What is allocated is not what is paid for
  • Fake Memory Leaks
  • HUP reload
Photo by Jose G. Ortega Castro
  • Slabs and pages
  • What is allocated is not what is paid for
  • Fake Memory Leaks
  • HUP reload

How OpenResty and Nginx Allocate and Manage Memory

  • On The System Level
  • On The Application Level
  • For Traditional Nginx Servers
Photo by Harrison Broadbent
  • On The System Level
  • On The Application Level
  • For Traditional Nginx Servers
Contact us

Love to hear from you, Get in touch 👋

Message was sent successfully!

Our Team will get back to you within 24 hours.
x