zhuizhuhaomeng Blog

「记录下来,一切都会更容易理解」

Examples of Linux find command

1 2 3 4 5 6 7 #!/bin/bash for name in `find / -maxdepth 1 -type d -regex "/[0-9]+t-[a-z]"`; do for d in `find /16t-a/trace-pkg-db -maxdepth 2 -type d -regex ".*/\(rpms\|debs\)"`; do f...

An exmaple of ssl_certificate_by_lua

1. the lua code save the following code to file /usr/local/openresty/site/lualib/dynamic_cert.lua 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 ...

HTTP error emulator

1. 模拟 HTTP 上游服务器不响应 (网关 504 超时) 以下 Go 程序作为源站 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 package main import ( ...

DWARF op code

elf 中 debug 相关的节 .debug_abbrev - Abbreviations used in the .debug_info section .debug_aranges - Lookup table for mapping addresses to compilation units .debug_frame - Call frame information...

systemctl examples

设置进程的调度属性 1 2 3 4 5 6 7 8 9 10 [Unit] Description=Machine Check Exception Logging Daemon [Service] ExecStart=/usr/sbin/mcelog --ignorenodev --daemon --foreground CPUSchedulingPolicy=fifo CPUSched...

gdb 读取 tls 变量

As answered in Using GDB to read MSRs, this is possible with gdb 8, using the registers $fs_base and $gs_base.

openssl 撤销证书

问题 lua-ngix-module 的测试用例中用到了撤销证书 t/cert/test.crl。在更新 t/cert/test.key 和 t/cert/test.crt 后忘记更新撤销证书列表导致用例失败。 那么如何生成撤销证书列表呢? 生成撤销证书列表 生成撤销证书列表需要用到 CA 证书,但是因为这里是自签名证书,因此就 CA 就算自签名证书本身。 下面的命令列表中给出了一些使...

How to use OpenResty shared dictionary

遇到的错误 使用 OpenResty 共享内存字典的同学偶尔会遇到 out of memory 的错误。那么这种错误是如何产生的,要怎么解决呢? 共享内存基本情况回顾 首先,我们来了解一下共享内存都有哪些特性。 从是否过期的角度,分成会过期和不会过期两种情况。 从在内存满的时候是否删除未过期表项可以分为强制删除和不删除未过期表项 从是否覆盖已经存在的表项分为覆盖和不覆盖...

how to build boringssl for HTTP3

compile command 1 2 3 4 5 6 7 8 9 10 11 12 13 git clone git@github.com:google/boringssl cd boringssl mkdir -p build cd build cmake -DBUILD_SHARED_LIBS=1 .. make -j$(nproc) make install cd .. rm -...

5 分钟帮客户定位 52G 内存泄漏的原因

Nginx 的内存池让 Nginx 的内存泄漏变得很不容易。不过我们的一个客户的 Nginx 进程却泄漏了 52G 的内存。 第一眼看到 Nginx worker 进程消耗了 52G 内存着实吓人。 我们观察一下 Nginx 的内存增长趋势,发现所有的 Nginx 进程内存都是 52G。这说明这些被使用的内存是被所有 Nginx 进程共享的。而共享内存是 Nginx 多进程通信之间的一个...