← Back
Luajit

Lua for OpenResty: Essential Syntax, Error Handling, and I/O Pitfalls

  • OpenResty runs LuaJIT, based on Lua 5.1
  • The minimum syntax needed to read OpenResty code
  • res, err error handling and ngx.null
  • Avoid blocking I/O during request processing
  • OpenResty runs LuaJIT, based on Lua 5.1
  • The minimum syntax needed to read OpenResty code
  • res, err error handling and ngx.null
  • Avoid blocking I/O during request processing

OpenResty Components: Modules, Lua Libraries, and How to Check Them

  • What common components do
  • The difference between NGINX modules and Lua libraries
  • Where components are installed
  • Checking which components your installation includes
  • Common questions
Photo by Yichun Zhang
  • What common components do
  • The difference between NGINX modules and Lua libraries
  • Where components are installed
  • Checking which components your installation includes
  • Common questions

LuaJIT in OpenResty: How It Works and How luajit2 Differs

  • Which Lua runtime OpenResty uses
  • How Lua code runs inside Nginx workers
  • How LuaJIT interprets and compiles code
  • How luajit2 differs from upstream LuaJIT
  • How LuaJIT-plus relates to the standard runtime
  • LuaJIT vs luajit2: frequently asked questions
  • Where to continue reading by problem
  • Which Lua runtime OpenResty uses
  • How Lua code runs inside Nginx workers
  • How LuaJIT interprets and compiles code
  • How luajit2 differs from upstream LuaJIT
  • How LuaJIT-plus relates to the standard runtime
  • LuaJIT vs luajit2: frequently asked questions
  • Where to continue reading by problem

What Is OpenResty? From Nginx and LuaJIT to Real-World Use Cases

  • What OpenResty Is Used For
  • How OpenResty Works
  • Do You Need to Know Lua?
  • Is OpenResty a Web Server? How Does It Relate to Nginx?
  • What OpenResty Is Made Of
  • Who Uses OpenResty
  • Who Maintains OpenResty
  • FAQ
Photo by Yichun Zhang
  • What OpenResty Is Used For
  • How OpenResty Works
  • Do You Need to Know Lua?
  • Is OpenResty a Web Server? How Does It Relate to Nginx?
  • What OpenResty Is Made Of
  • Who Uses OpenResty
  • Who Maintains OpenResty
  • FAQ

Fix LuaJIT RSS Memory Leak in OpenResty: Stop OOM Kills Without Restarts

  • What Is the LuaJIT Pseudo Memory Leak?
  • Diagnosing the Problem with Real Production Data
  • Why Standard Fixes Don’t Work
  • How LuaJIT-plus Fixes This at the Allocator Level
  • Production Impact After Deployment
  • What Is the LuaJIT Pseudo Memory Leak?
  • Diagnosing the Problem with Real Production Data
  • Why Standard Fixes Don’t Work
  • How LuaJIT-plus Fixes This at the Allocator Level
  • Production Impact After Deployment

Automatic Core Dump Analysis (using OpenResty XRay)

  • Locate the core dump file from a crashed OpenResty/Nginx worker
  • Start automatic (guided) core dump analysis in OpenResty XRay
  • Read the signal, CPU registers, and C backtrace of the crash
  • Follow the Lua backtrace to the exact crashing line
  • Automatic Insights reports for online core dumps
  • Locate the core dump file from a crashed OpenResty/Nginx worker
  • Start automatic (guided) core dump analysis in OpenResty XRay
  • Read the signal, CPU registers, and C backtrace of the crash
  • Follow the Lua backtrace to the exact crashing line
  • Automatic Insights reports for online core dumps

Lua CPU Flame Graphs: Profiling LuaJIT in Production

  • What Is a Lua CPU Flame Graph
  • Profiling simple LuaJIT apps: verifying accuracy
  • Profiling complex LuaJIT apps in production
  • Sampling Overhead
  • Production safety: not a single bit changed
  • Compatibility
  • FAQ
Photo by Guido Jansen
  • What Is a Lua CPU Flame Graph
  • Profiling simple LuaJIT apps: verifying accuracy
  • Profiling complex LuaJIT apps in production
  • Sampling Overhead
  • Production safety: not a single bit changed
  • Compatibility
  • FAQ

LuaJIT GC64 Mode: Removing the 2GB Memory Limit

  • The Old Memory Limit
    • When Hitting The Memory Limit
    • The Memory Limit Is Per Process
    • GC-Managed Memory
    • Memory Allocated Outside GC
    • Extending The x64 Mode to The 4 GB Limit
  • The New GC64 Mode
    • How to Enable The GC64 Mode
    • Performance Impact
    • Debugging and Profiling Tool Chains
  • The Old Memory Limit
    • When Hitting The Memory Limit
    • The Memory Limit Is Per Process
    • GC-Managed Memory
    • Memory Allocated Outside GC
    • Extending The x64 Mode to The 4 GB Limit
  • The New GC64 Mode
    • How to Enable The GC64 Mode
    • Performance Impact
    • Debugging and Profiling Tool Chains
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