A set of studies about how Nginx works and how it interacts with the operating system under the hoods.
Each directory is a study, with a README file containing the instructions to reproduce it, some logs and notes.
- sendfile
- tcp_nopush
- TODO: kTLS
- TODO: http/2
- TODO: http/3
All studies requires an OpenResty docker image with debug flag and strace.
-
Clone the docker-openresty repo
-
Add the flag
--with-debug
inside theRESTY_CONFIG_OPTIONS
in filealpine/Dockerfile
:ARG RESTY_CONFIG_OPTIONS="\ --with-debug \ --with-compat \ // other lines
-
Add the instruction
RUN apk add strace
before the copy of Nginx conf files inalpine/Dockerfile
:# Add additional binaries into PATH for convenience ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin RUN apk add strace # Copy nginx configuration files COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
-
Build the Nginx:
docker build -t openresty-with-debug:latest -f alpine/Dockerfile .
-
Run Nginx:
make run
-
In another terminal, attach the strace process to Nginx:
make strace
-
In another terminal, reload the Nginx:
make reload
-
Make the requests. Each study has its own instructions about this step.