Skip to content

Instantly share code, notes, and snippets.

View theraw's full-sized avatar
🤨
u wot

𝓙𝓾𝓵𝓲𝓸 theraw

🤨
u wot
View GitHub Profile
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
; supervisor config file
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
diff --git a/auto/modules b/auto/modules
index 09bfcb08..645eb897 100644
--- a/auto/modules
+++ b/auto/modules
@@ -438,6 +438,10 @@ if [ $HTTP = YES ]; then
. auto/module
fi
+ if [ $HTTP_V2_HPACK_ENC = YES ]; then
+ have=NGX_HTTP_V2_HPACK_ENC . auto/have
What we do now:
We use a static record size of 4K. This gives a good balance of latency and
throughput.
Optimize latency:
By initialy sending small (1 TCP segment) sized records, we are able to avoid
HoL blocking of the first byte. This means TTFB is sometime lower by a whole
RTT.
Optimizing throughput:
@theraw
theraw / naxsi
Last active January 1, 2023 04:27
#!/bin/bash
export FOCAL_VERSION_NGINX="1.22.1"
mkdir -p /opt/mod
cd /opt/mod/; git clone --recurse-submodules https://github.com/wargio/naxsi.git naxsi
rm -Rf /opt/nginx-${FOCAL_VERSION_NGINX}.tar.gz; cd /opt/; wget https://nginx.org/download/nginx-${FOCAL_VERSION_NGINX}.tar.gz; tar xf nginx-${FOCAL_VERSION_NGINX}.tar.gz; rm -Rf nginx-${FOCAL_VERSION_NGINX}.tar.gz
cd /opt/nginx-${FOCAL_VERSION_NGINX} && curl -s https://raw.githubusercontent.com/hakasenyang/openssl-patch/master/nginx_hpack_push_1.15.3.patch > hpack_push.patch && patch -p1 < hpack_push.patch
cd /opt/nginx-${FOCAL_VERSION_NGINX}/
LUAJIT_LIB="/usr/local/LuaJIT/lib" LUAJIT_INC="/usr/local/LuaJIT/include/luajit-2.1/" ./configure --with-compat \
--user=nginx \
--group=nginx \
[php74]
user = nginx
group = nginx
listen = 127.0.0.1:9074
listen.owner = nginx
listen.group = nginx
pm = ondemand
pm.max_children = 5000
pm.process_idle_timeout = 15s;
[php82]
user = nginx
group = nginx
listen = 127.0.0.1:9082
listen.owner = nginx
listen.group = nginx
pm = ondemand
pm.max_children = 5000
pm.process_idle_timeout = 15s;
@theraw
theraw / nginx.conf
Last active November 30, 2022 09:22
location ~ \.php {
try_files $uri $uri /index.php =404;
fastcgi_pass 127.0.0.1:9072;
fastcgi_buffers 16 256k;
fastcgi_buffer_size 256k;
fastcgi_index index.php;
fastcgi_read_timeout 30;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
@theraw
theraw / nginx.conf
Last active November 30, 2022 09:24
location ~ \.php {
try_files $uri $uri /index.php =404;
fastcgi_pass 127.0.0.1:9081;
fastcgi_buffers 16 256k;
fastcgi_buffer_size 256k;
fastcgi_index index.php;
fastcgi_read_timeout 30;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",