Giter Site home page Giter Site logo

lax / traffic-accounting-nginx-module Goto Github PK

View Code? Open in Web Editor NEW
276.0 19.0 74.0 710 KB

Monitor the incoming and outgoing traffic metrics in realtime for NGINX

Home Page: https://github.com/Lax/traffic-accounting-nginx-module

License: BSD 2-Clause "Simplified" License

C 100.00%
nginx traffic-metrics realtime observability traffic-accounting

traffic-accounting-nginx-module's Introduction

traffic-accounting-nginx-module

Monitor the incoming and outgoing traffic metrics in realtime for NGINX.

Now accounting module supports both HTTP and STREAM subsystems

A realtime traffic and status code monitor solution for NGINX, which needs less memory and cpu than other realtime log analyzing solutions. Useful for traffic accounting based on NGINX config logic (by location / server / user-defined-variables).

FOSSA Status Financial Contributors on Open Collective

Why?

Realtime log analysis solutions, which requires multiple machines for storage and analysis, are too heavy for application monitoring.

An cost-effective solution is in need to monitor the traffic metrics/status of application requests. This solution should be accurate, sensitive, robust, light weight enough, and not affected by traffic peaks.

How it works?

This module keeps a list of metrics identified by accounting_id in its context.

When a new request hits the server, the module will try to find its accounting_id, calculate statistics, and aggregate them into the corresponding metrics by accounting_id.

For each time period (defined by interval), a timer event is triggered, those metrics are rotated and exported to log files or sent to remote log servers.


Quickstart

Download pre-build binaries from Releases, place them into ./modules sub-directory of nginx.

Add following lines at the beginning of nginx.conf:

load_module modules/ngx_http_accounting_module.so;

Reload nginx config with nginx -s reload. Done!

Alternatively, you can install this module manually with the Nginx source, see the installation instructions


Dashboard

Dashboard - Visualize with Grafana Accounting Dashboard


Configuration

Edit your nginx.conf.

Example:

http{
    # turn on accounting function
    accounting  on;
    accounting_log  logs/http-accounting.log;
    ...
    server {
        server_name example.com;

        accounting_id  $http_host;  # set accounting_id string by variable

        location / {
            accounting_id  accounting_id_str;  # set accounting_id string by location

            ...
        }

        location /api {
            accounting_id  API_PC;   # for pc

            if ($http_user_agent ~* '(Android|webOS|iPhone|iPod|BlackBerry)') {
                accounting_id  API_MOBILE;   # for mobile
            }

            ...
        }
    }

}

Directives

accounting

syntax: accounting on | off

default: accounting off

context: http, stream

accounting_log

syntax: accounting_log </path/to/log/file> [level]

default: -

context: http, stream

Configures logging.

Support both local file path, or stderr, or syslog:. The second parameter is the log level. For more details of supported params, refer to this page from nginx.org.

If not specified, accounting log will be written to /dev/log.

accounting_id

syntax: accounting_id <accounting_id>

default: accounting_id default

context: http, stream, server, location, if in location

Sets the accounting_id string by user defined variable.

This string is used to determine which metrics a request/session should be aggregated to.

accounting_interval

syntax: accounting_interval <seconds>

default: accounting_interval 60

context: http, stream

Specifies the reporting interval. Defaults to 60 seconds.

accounting_perturb

syntax: accounting_perturb on | off

default: accounting_perturb off

context: http, stream

Randomly staggers the reporting interval by 20% from the usual time.

Usage

This module can be configured to writes metrics to local file, remote log server or local syslog device.

Open-source log-aggregation software such as logstash also support syslog input, which will help you establish a central log server. See samples/logstash/ for examples. [Recommended]

To collect logs with local syslog, refer Lax/ngx_http_accounting_module-utils to for sample configuration / utils.

docker / docker-compose

To demonstrate with docker-compose, run

docker-compose build
docker-compose up -d

Open Grafana (address: http://localhost:3000) in your browser.

Create and configurate elasticsearch datasource with options:

Type: elasticsearch
URL: http://elasticsearch:9200
Version: 5.6+
Min time interval: 1m

Then import accounting dashboard from samples/accounting-dashboard-grafana.json.

Metrics log format

# HTTP
2018/05/14 14:18:18 [notice] 5#0: pid:5|from:1526278638|to:1526278659|accounting_id:HTTP_ECHO_HELLO|requests:4872|bytes_in:438480|bytes_out:730800|latency_ms:0|upstream_latency_ms:0|200:4872
2018/05/14 14:18:18 [notice] 5#0: pid:5|from:1526278638|to:1526278659|accounting_id:INDEX|requests:4849|bytes_in:421863|bytes_out:1857167|latency_ms:0|upstream_latency_ms:0|301:4849

# Stream
2018/05/14 14:18:22 [notice] 5#0: pid:5|from:1526278642|to:1526278659|accounting_id:TCP_PROXY_ECHO|sessions:9723|bytes_in:860343|bytes_out:2587967|latency_ms:4133|upstream_latency_ms:3810|200:9723

Each line of the log output contains metrics for a particular accounting_id, which contains a list of key-values.

key name meanings of values
pid pid of nginx worker process
from / to metric was collected from the period between these timestamps
accounting_id identify for the accounting unit, set by accounting_id directive
requests count of total requests processed in current period (HTTP module only)
sessions count of total sessions processed in current period (Stream module only)
bytes_in total bytes received by the server
bytes_out total bytes send out by the server
latency_ms sum of all requests/sessions' $session_time, in millisecond
upstream_latency_ms sum of $upstream_response_time, in millisecond
200 / 302 / 400 / 404 / 500 ... count of requests/sessions with status code 200/302/400/404/500, etc. Notice the differences between http codes and stream codes

Installation

Step 1

There are several ways to integrate traffic accounting functions into NGINX.

  • Download pre-build binaries from Releases.

  • Build the binaries from sources

# grab nginx source code from nginx.org, then cd to /path/to/nginx-src/
git clone https://github.com/Lax/traffic-accounting-nginx-module.git

# to build as `static` module
./configure --prefix=/opt/nginx --with-stream --add-module=traffic-accounting-nginx-module
make && make install


# to build as `dynamic` module
# both HTTP and STREAM module, target module file name is ngx_http_accounting_module.so
./configure --prefix=/opt/nginx --with-stream --add-dynamic-module=traffic-accounting-nginx-module

# only HTTP module, target module file name is ngx_http_accounting_module.so
#./configure --prefix=/opt/nginx --add-dynamic-module=traffic-accounting-nginx-module

# only STREAM module, target module file name is ngx_stream_accounting_module.so
#./configure --prefix=/opt/nginx --without-http --add-dynamic-module=traffic-accounting-nginx-module

make modules

Step 2 (dynamic module only)

Add the following lines at the beginning of nginx.conf:

load_module modules/ngx_http_accounting_module.so;

# for STREAM only build
#load_module modules/ngx_stream_accounting_module.so;

Step 3

http {
  accounting        on;
  accounting_log    logs/http-accounting.log;
  accounting_id     $hostname;

  ...
}

stream {
  accounting        on;
  accounting_log    logs/stream-accounting.log;
  accounting_id     $hostname;

  ...
}

Visualization

Visualization with Kibana or Grafana is easy. See samples/ for examples.


Branches

  • master : main development branch.
  • tag v0.1 or v2-freeze-20110526 : legacy release. works with nginx version(0.7.xx, 0.8.xx), nginx 0.9 is not tested. didn't work with nginx above 1.0.x.

Contributing

  1. Fork it ( https://github.com/Lax/traffic-accounting-nginx-module/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Known issues

Author

Liu Lantao Github@Lax

Contributors

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

BSD-2-Clause

FOSSA Status

traffic-accounting-nginx-module's People

Contributors

fossabot avatar keschercode avatar lax avatar monkeywithacupcake avatar splitice avatar steinnes avatar wangfakang avatar zypa13510 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

traffic-accounting-nginx-module's Issues

Dynamic module undefined symbol ngx_stream_get_variable_index problem

Hello,
I can't launch your dynamic module with my nginx, tried using prebuild modules & build my own, but the problem persists.

Nginx Build

nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.1.1c FIPS  28 May 2019 (running with OpenSSL 1.1.1g FIPS  21 Apr 2020)
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-stream_ssl_preread_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'

Module Configuration

./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --with-stream --add-dynamic-module=traffic-accounting-nginx-module

Module Config Response

checking for OS
 + Linux 3.10.0-1127.19.1.el7.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for EPOLLEXCLUSIVE ... not found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for prctl(PR_SET_KEEPCAPS) ... found
checking for capabilities ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for sched_setaffinity() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... found
checking for IP_RECVDSTADDR ... not found
checking for IP_SENDSRCADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for clock_gettime(CLOCK_MONOTONIC) ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional dynamic modules
adding module in traffic-accounting-nginx-module
 + traffic-accounting-nginx-module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for zlib library ... found
creating objs/Makefile

Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/usr/share/nginx"
  nginx binary file: "/usr/sbin/nginx"
  nginx modules path: "/usr/lib64/nginx/modules"
  nginx configuration prefix: "/etc/nginx"
  nginx configuration file: "/etc/nginx/nginx.conf"
  nginx pid file: "/usr/share/nginx/logs/nginx.pid"
  nginx error log file: "/usr/share/nginx/logs/error.log"
  nginx http access log file: "/usr/share/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

Make Module Response

make -f objs/Makefile modules
make[1]: Entering directory `/home/modbak/nginx/source/nginx-1.16.1'
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/src/ngx_traffic_accounting_log.o \
        traffic-accounting-nginx-module/src/ngx_traffic_accounting_log.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/src/ngx_traffic_accounting_module.o \
        traffic-accounting-nginx-module/src/ngx_traffic_accounting_module.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/src/ngx_traffic_accounting_module_conf.o \
        traffic-accounting-nginx-module/src/ngx_traffic_accounting_module_conf.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/src/ngx_traffic_accounting_period_metrics.o \
        traffic-accounting-nginx-module/src/ngx_traffic_accounting_period_metrics.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/src/ngx_traffic_accounting_statuses.o \
        traffic-accounting-nginx-module/src/ngx_traffic_accounting_statuses.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/http/ngx_http_accounting_module.o \
        traffic-accounting-nginx-module/src/http/ngx_http_accounting_module.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/http/ngx_http_accounting_statuses.o \
        traffic-accounting-nginx-module/src/http/ngx_http_accounting_statuses.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/stream/ngx_stream_accounting_module.o \
        traffic-accounting-nginx-module/src/stream/ngx_stream_accounting_module.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/addon/stream/ngx_stream_accounting_statuses.o \
        traffic-accounting-nginx-module/src/stream/ngx_stream_accounting_statuses.c
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I traffic-accounting-nginx-module -I objs -I src/http -I src/http/modules -I src/stream \
        -o objs/ngx_http_accounting_module_modules.o \
        objs/ngx_http_accounting_module_modules.c
cc -o objs/ngx_http_accounting_module.so \
objs/addon/src/ngx_traffic_accounting_log.o \
objs/addon/src/ngx_traffic_accounting_module.o \
objs/addon/src/ngx_traffic_accounting_module_conf.o \
objs/addon/src/ngx_traffic_accounting_period_metrics.o \
objs/addon/src/ngx_traffic_accounting_statuses.o \
objs/addon/http/ngx_http_accounting_module.o \
objs/addon/http/ngx_http_accounting_statuses.o \
objs/addon/stream/ngx_stream_accounting_module.o \
objs/addon/stream/ngx_stream_accounting_statuses.o \
objs/ngx_http_accounting_module_modules.o \
-shared
make[1]: Leaving directory `/home/modbak/nginx/source/nginx-1.16.1'

After build steps

  1. Move objs/ngx_http_accounting_module.so to /usr/lib64/nginx/modules/ngx_http_accounting_module.so
  2. Load my module from config like this: load_module "/usr/lib64/nginx/modules/ngx_http_accounting_module.so";
  3. call nginx -s reload

Error

nginx: [emerg] dlopen() "/usr/lib64/nginx/modules/ngx_http_accounting_module.so" failed (/usr/lib64/nginx/modules/ngx_http_accounting_module.so: undefined symbol: ngx_stream_get_variable_index) in /usr/share/nginx/modules/mod-http-accounting-module.conf:5

Any suggestions? Thank you.

Feature request: reset counters once a month

Hello there. It would be very useful to have a configuration setting to reset counters once a month to keep track of the monthly bandwidth in Heroku dynos where there's a 2TB soft limit but there's no way to know the used traffic.
Thanks a lot!

Memory leak

Memory leak detected when running the nginx for a long time. Reproducible by introducing a rapid accounting_interval e.g. 1s
with ~0.9KB per report period per nginx worker

reading file "heaptrack.nginx.4144.0917.gz" - please wait, this might take some time...
reading diff file "heaptrack.nginx.4144.0742.gz" - please wait, this might take some time...
Debuggee command was: Debuggee command was: ./sbin/nginx -c /myworkspace/nginx/sbin/nginx.conf./sbin/nginx -c /myworkspace/nginx/sbin/nginx.conf

finished reading file, now analyzing data:

MOST CALLS TO ALLOCATION FUNCTIONS
144733 calls to allocation functions with 2.63MB peak consumption from
ngx_memalign
  at src/os/unix/ngx_alloc.c:57
  in /myworkspace/nginx/sbin/nginx
48191 calls with 512B peak consumption from:
    ngx_create_pool
      at src/core/ngx_palloc.c:23
      in /myworkspace/nginx/sbin/nginx
    ngx_event_accept
      at src/event/ngx_event_accept.c:156
      in /myworkspace/nginx/sbin/nginx
    .
    .
    .
    .
    .


PEAK MEMORY CONSUMERS

WARNING - the data below is not an accurate calcuation of the total peak consumption and can easily be wrong.
 For an accurate overview, disable backtrace merging.
2.63MB peak memory consumed over 144733 calls from
ngx_memalign
  at src/os/unix/ngx_alloc.c:57
  in /myworkspace/nginx/sbin/nginx
999.42KB consumed over 61 calls from:
    ngx_palloc_block
      at src/core/ngx_palloc.c:186
      in /myworkspace/nginx/sbin/nginx
    ngx_palloc
      at src/core/ngx_palloc.c:127
      in /myworkspace/nginx/sbin/nginx
    .
    .
    .
    .
    .

MEMORY LEAKS
2.62MB leaked over 144733 calls from
ngx_memalign
  at src/os/unix/ngx_alloc.c:57
  in /myworkspace/nginx/sbin/nginx
999.42KB leaked over 61 calls from:
    ngx_palloc_block
      at src/core/ngx_palloc.c:186
      in /myworkspace/nginx/sbin/nginx
    ngx_palloc
      at src/core/ngx_palloc.c:127
      in /myworkspace/nginx/sbin/nginx
    ngx_pcalloc
      at src/core/ngx_palloc.c:302
      in /myworkspace/nginx/sbin/nginx
    ngx_traffic_accounting_metrics_init
      at ../traffic-accounting-nginx-module-43c9b9d/src/ngx_traffic_accounting_period_metrics.c:23
      in /myworkspace/nginx/sbin/nginx
    ngx_http_accounting_request_handler
      at ../traffic-accounting-nginx-module-43c9b9d/src/http/ngx_http_accounting_module.c:249
      in /myworkspace/nginx/sbin/nginx
    ngx_http_log_request
      at src/http/ngx_http_request.c:3674
      in /myworkspace/nginx/sbin/nginx
    ngx_http_free_request
      at src/http/ngx_http_request.c:3620
      in /myworkspace/nginx/sbin/nginx
    ngx_http_finalize_connection
      at src/http/ngx_http_request.c:2720
      in /myworkspace/nginx/sbin/nginx
    ngx_http_finalize_request
      at src/http/ngx_http_request.c:2612
      in /myworkspace/nginx/sbin/nginx
    ngx_http_core_rewrite_phase
      at src/http/ngx_http_core_module.c:925
      in /myworkspace/nginx/sbin/nginx
    ngx_http_core_run_phases
      at src/http/ngx_http_core_module.c:858
      in /myworkspace/nginx/sbin/nginx
    ngx_http_handler
      at src/http/ngx_http_core_module.c:841
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request
      at src/http/ngx_http_request.c:2055
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request_headers
      at src/http/ngx_http_request.c:1480
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request_line
      at src/http/ngx_http_request.c:1151
      in /myworkspace/nginx/sbin/nginx
    ngx_http_wait_request_handler
      at src/http/ngx_http_request.c:500
      in /myworkspace/nginx/sbin/nginx
    ngx_epoll_process_events
      at src/event/modules/ngx_epoll_module.c:902
      in /myworkspace/nginx/sbin/nginx
    ngx_process_events_and_timers
      at src/event/ngx_event.c:242
      in /myworkspace/nginx/sbin/nginx
    ngx_single_process_cycle
      at src/os/unix/ngx_process_cycle.c:310
      in /myworkspace/nginx/sbin/nginx
    main
      at src/core/nginx.c:379
      in /myworkspace/nginx/sbin/nginx
983.04KB leaked over 60 calls from:
    ngx_palloc_block
      at src/core/ngx_palloc.c:186
      in /myworkspace/nginx/sbin/nginx
    ngx_palloc
      at src/core/ngx_palloc.c:127
      in /myworkspace/nginx/sbin/nginx
    ngx_pcalloc
      at src/core/ngx_palloc.c:302
      in /myworkspace/nginx/sbin/nginx
    ngx_traffic_accounting_metrics_init
      at ../traffic-accounting-nginx-module-43c9b9d/src/ngx_traffic_accounting_period_metrics.c:16
      in /myworkspace/nginx/sbin/nginx
    ngx_http_accounting_request_handler
      at ../traffic-accounting-nginx-module-43c9b9d/src/http/ngx_http_accounting_module.c:249
      in /myworkspace/nginx/sbin/nginx
    ngx_http_log_request
      at src/http/ngx_http_request.c:3674
      in /myworkspace/nginx/sbin/nginx
    ngx_http_free_request
      at src/http/ngx_http_request.c:3620
      in /myworkspace/nginx/sbin/nginx
    ngx_http_finalize_connection
      at src/http/ngx_http_request.c:2720
      in /myworkspace/nginx/sbin/nginx
    ngx_http_finalize_request
      at src/http/ngx_http_request.c:2612
      in /myworkspace/nginx/sbin/nginx
    ngx_http_core_rewrite_phase
      at src/http/ngx_http_core_module.c:925
      in /myworkspace/nginx/sbin/nginx
    ngx_http_core_run_phases
      at src/http/ngx_http_core_module.c:858
      in /myworkspace/nginx/sbin/nginx
    ngx_http_handler
      at src/http/ngx_http_core_module.c:841
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request
      at src/http/ngx_http_request.c:2055
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request_headers
      at src/http/ngx_http_request.c:1480
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request_line
      at src/http/ngx_http_request.c:1151
      in /myworkspace/nginx/sbin/nginx
    ngx_http_wait_request_handler
      at src/http/ngx_http_request.c:500
      in /myworkspace/nginx/sbin/nginx
    ngx_epoll_process_events
      at src/event/modules/ngx_epoll_module.c:902
      in /myworkspace/nginx/sbin/nginx
    ngx_process_events_and_timers
      at src/event/ngx_event.c:242
      in /myworkspace/nginx/sbin/nginx
    ngx_single_process_cycle
      at src/os/unix/ngx_process_cycle.c:310
      in /myworkspace/nginx/sbin/nginx
    main
      at src/core/nginx.c:379
      in /myworkspace/nginx/sbin/nginx
360.45KB leaked over 22 calls from:
    ngx_palloc_block
      at src/core/ngx_palloc.c:186
      in /myworkspace/nginx/sbin/nginx
    ngx_palloc
      at src/core/ngx_palloc.c:127
      in /myworkspace/nginx/sbin/nginx
    ngx_pcalloc
      at src/core/ngx_palloc.c:302
      in /myworkspace/nginx/sbin/nginx
    ngx_traffic_accounting_period_insert
      at ../traffic-accounting-nginx-module-43c9b9d/src/ngx_traffic_accounting_period_metrics.c:46
      in /myworkspace/nginx/sbin/nginx
    ngx_traffic_accounting_period_fetch_metrics
      at ../traffic-accounting-nginx-module-43c9b9d/src/ngx_traffic_accounting_period_metrics.c:135
      in /myworkspace/nginx/sbin/nginx
    ngx_http_accounting_request_handler
      at ../traffic-accounting-nginx-module-43c9b9d/src/http/ngx_http_accounting_module.c:246
      in /myworkspace/nginx/sbin/nginx
    ngx_http_log_request
      at src/http/ngx_http_request.c:3674
      in /myworkspace/nginx/sbin/nginx
    ngx_http_free_request
      at src/http/ngx_http_request.c:3620
      in /myworkspace/nginx/sbin/nginx
    ngx_http_finalize_connection
      at src/http/ngx_http_request.c:2720
      in /myworkspace/nginx/sbin/nginx
    ngx_http_finalize_request
      at src/http/ngx_http_request.c:2612
      in /myworkspace/nginx/sbin/nginx
    ngx_http_core_rewrite_phase
      at src/http/ngx_http_core_module.c:925
      in /myworkspace/nginx/sbin/nginx
    ngx_http_core_run_phases
      at src/http/ngx_http_core_module.c:858
      in /myworkspace/nginx/sbin/nginx
    ngx_http_handler
      at src/http/ngx_http_core_module.c:841
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request
      at src/http/ngx_http_request.c:2055
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request_headers
      at src/http/ngx_http_request.c:1480
      in /myworkspace/nginx/sbin/nginx
    ngx_http_process_request_line
      at src/http/ngx_http_request.c:1151
      in /myworkspace/nginx/sbin/nginx
    ngx_http_wait_request_handler
      at src/http/ngx_http_request.c:500
      in /myworkspace/nginx/sbin/nginx
    ngx_epoll_process_events
      at src/event/modules/ngx_epoll_module.c:902
      in /myworkspace/nginx/sbin/nginx
    ngx_process_events_and_timers
      at src/event/ngx_event.c:242
      in /myworkspace/nginx/sbin/nginx
    ngx_single_process_cycle
      at src/os/unix/ngx_process_cycle.c:310
      in /myworkspace/nginx/sbin/nginx
    main
      at src/core/nginx.c:379
      in /myworkspace/nginx/sbin/nginx
278.53KB leaked over 17 calls from:
    ngx_palloc_block
      at src/core/ngx_palloc.c:186
      in /myworkspace/nginx/sbin/nginx
    ngx_palloc
      at src/core/ngx_palloc.c:127
      in /myworkspace/nginx/sbin/nginx
    ngx_pcalloc
      at src/core/ngx_palloc.c:302
      in /myworkspace/nginx/sbin/nginx
    ngx_traffic_accounting_period_create
      at ../traffic-accounting-nginx-module-43c9b9d/src/ngx_traffic_accounting_module.c:16
      in /myworkspace/nginx/sbin/nginx
    ngx_traffic_accounting_period_rotate
      at ../traffic-accounting-nginx-module-43c9b9d/src/ngx_traffic_accounting_module.c:37
      in /myworkspace/nginx/sbin/nginx
    worker_process_alarm_handler
      at ../traffic-accounting-nginx-module-43c9b9d/src/http/ngx_http_accounting_module.c:209
      in /myworkspace/nginx/sbin/nginx
    ngx_event_expire_timers
      at src/event/ngx_event_timer.c:94
      in /myworkspace/nginx/sbin/nginx
    ngx_process_events_and_timers
      at src/event/ngx_event.c:256
      in /myworkspace/nginx/sbin/nginx
    ngx_single_process_cycle
      at src/os/unix/ngx_process_cycle.c:310
      in /myworkspace/nginx/sbin/nginx
    main
      at src/core/nginx.c:379
      in /myworkspace/nginx/sbin/nginx
512B leaked over 48191 calls from:
    ngx_create_pool
      at src/core/ngx_palloc.c:23
      in /myworkspace/nginx/sbin/nginx
    ngx_event_accept
      at src/event/ngx_event_accept.c:156
      in /myworkspace/nginx/sbin/nginx
    ngx_epoll_process_events
      at src/event/modules/ngx_epoll_module.c:902
      in /myworkspace/nginx/sbin/nginx
    ngx_process_events_and_timers
      at src/event/ngx_event.c:242
      in /myworkspace/nginx/sbin/nginx
    ngx_single_process_cycle
      at src/os/unix/ngx_process_cycle.c:310
      in /myworkspace/nginx/sbin/nginx
    main
      at src/core/nginx.c:379
      in /myworkspace/nginx/sbin/nginx
  and 0B from 2 other places

-2.16KB leaked over 0 calls from
ngx_strerror_init
  at src/os/unix/ngx_errno.c:60
  in /myworkspace/nginx/sbin/nginx
-2.16KB leaked over 0 calls from:
    main
      at src/core/nginx.c:206
      in /myworkspace/nginx/sbin/nginx

1.02KB leaked over 96382 calls from
ngx_alloc
  at src/os/unix/ngx_alloc.c:22
  in /myworkspace/nginx/sbin/nginx
1.02KB leaked over 48191 calls from:
    ngx_palloc_large
      at src/core/ngx_palloc.c:220
      in /myworkspace/nginx/sbin/nginx
    ngx_palloc
      at src/core/ngx_palloc.c:131
      in /myworkspace/nginx/sbin/nginx
    ngx_http_keepalive_handler
      at src/http/ngx_http_request.c:3261
      in /myworkspace/nginx/sbin/nginx
    ngx_epoll_process_events
      at src/event/modules/ngx_epoll_module.c:902
      in /myworkspace/nginx/sbin/nginx
    ngx_process_events_and_timers
      at src/event/ngx_event.c:242
      in /myworkspace/nginx/sbin/nginx
    ngx_single_process_cycle
      at src/os/unix/ngx_process_cycle.c:310
      in /myworkspace/nginx/sbin/nginx
    main
      at src/core/nginx.c:379
      in /myworkspace/nginx/sbin/nginx
0B leaked over 48191 calls from:
    ngx_palloc_large
      at src/core/ngx_palloc.c:220
      in /myworkspace/nginx/sbin/nginx
    ngx_palloc
      at src/core/ngx_palloc.c:131
      in /myworkspace/nginx/sbin/nginx
    ngx_create_temp_buf
      at src/core/ngx_buf.c:22
      in /myworkspace/nginx/sbin/nginx
    ngx_http_wait_request_handler
      at src/http/ngx_http_request.c:408
      in /myworkspace/nginx/sbin/nginx
    ngx_epoll_process_events
      at src/event/modules/ngx_epoll_module.c:902
      in /myworkspace/nginx/sbin/nginx
    ngx_process_events_and_timers
      at src/event/ngx_event.c:242
      in /myworkspace/nginx/sbin/nginx
    ngx_single_process_cycle
      at src/os/unix/ngx_process_cycle.c:310
      in /myworkspace/nginx/sbin/nginx
    main
      at src/core/nginx.c:379
      in /myworkspace/nginx/sbin/nginx


MOST TEMPORARY ALLOCATIONS
48190 temporary allocations of 96382 allocations in total (50.00%) from
ngx_alloc
  at src/os/unix/ngx_alloc.c:22
  in /myworkspace/nginx/sbin/nginx
48190 temporary allocations of 48191 allocations in total (100.00%) from:
    ngx_palloc_large
      at src/core/ngx_palloc.c:220
      in /myworkspace/nginx/sbin/nginx
    ngx_palloc
      at src/core/ngx_palloc.c:131
      in /myworkspace/nginx/sbin/nginx
    .
    .
    .
    .
    .


total runtime: 5998.42s.
bytes allocated in total (ignoring deallocations): 520.77MB (86.82KB/s)
calls to allocation functions: 241115 (40/s)
temporary memory allocations: 48190 (8/s)
peak heap memory consumption: 2.63MB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 2.62MB

It is caused by the accounting data allocating memory from nginx pool memory of conf. However, the small memory pool will only be released after the whole memory pool releases. While the conf memory pool is never release.
It caused the conf memory pool keep expanding and introduce a memory leak

Pre-build binaries

Hello!
I don't see any binaries in releases. Is the documentation actual?

Feature request: combined log entries

Right now, we get 1 log entry per child process per accounting_id.

Since I am running 12 children with 40 different accounting ids, I get a total of 480 log entries every 10 minutes.

It would nice to be possible to only get the sum of all children per accounting_id, which would lower the total count to 40.

Improve accounting for `Slow-Requests`

There are slow-requests, no matter they're long-polling or streaming request, or just downloading large files over poor networks(high drop rate and latency).

Previous version of nginx-http-accounting-module only count requests when they have finished transfer, to be more precisely, at NGX_HTTP_LOG_PHASE phase of the request.
Slow-requests don't have chance to log there transfer metrics before it's finished.

To handle this situation, a timer handler should find all the slow requests, export their metrics at the beginning of normal output process.

Support for variable in accounting_id

I have a patch that allows something like
http_accounting_id $host;

also allows putting any variable. Backwards compatible with normal string. But I can't upload it here, github is buggy.

QUESTION: Any practical way to use this module with multiple Independent servers?

I've builded a CDN to deliver static content to my users. To deliver the content, I'm using NGINX. But now I also would like to count traffic usage for each user (webdav users are meant here)

The problem is that each of my servers work independently, there is no Kubernetes or so that manages the servers or is able to aggregate logs from different servers. Is there any practical way where I can use the module in that way, that it doesn't matter on which server the traffic occurs? Besides, I'm using a load balancer in front, where I have no influence onto the configs it runs, so I really can only work with the NGINX servers at the backend for the traffic accounting.

Currently, my architecture looks like this:

User Request <-> Load balancer <-> NGINX Servers

Or can I simply get rid of this problem by simply using a single dedicated syslog server?

Thanks in advance

Feature request

Hi,

I have taken a look at your module, it looks interesting. Any chance of a feature request? http_accounting_skip when non zero skip accounting for this request. This is similar to proxy_cache_skip and its kin.

This would allow for usage in say cached responses or certain cases to be ignored.

openresty 无法编译安装

configure arguments: --prefix=/opt/openresty/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.0 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.13 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.5 --with-ld-opt=-Wl,-rpath,/opt/openresty/luajit/lib --with-stream --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_realip_module --with-pcre --with-openssl=/opt/src/libressl-2.7.4 --with-stream --with-stream_ssl_module

这是编译了的模块,添加这个traffic-accounting-nginx-module 模块进行编译 就会报错,是不是有什么和你的模块重复了

v1.3版本编译报错,二进制不兼容

我使用的是nginx-1.10.2版本,在configurate的时候会报错:
traffic-accounting-nginx-module-1.3/src/ngxta_http_statuses.c:30:5: error: ‘NGX_HTTP_PERMANENT_REDIRECT’ undeclared here (not in a function)
traffic-accounting-nginx-module-1.3/src/ngxta_http_statuses.c:45:5: error: ‘NGX_HTTP_TOO_MANY_REQUESTS’ undeclared here (not in a function)
traffic-accounting-nginx-module-1.3/src/ngxta_http_statuses.c:58:5: error: ‘NGX_HTTP_VERSION_NOT_SUPPORTED’ undeclared here (not in a function)
去掉之后,configuratite正常了,编译后生成的so文件,拷贝到同样的系统,会报错:
module "/data/services/nginx-1.10.2.3/modules/ngx_http_accounting_module.so" is not binary compatible in /data/services/nginx-1.10.2.3/conf/nginx.conf:18
加入的内容是:load_module modules/ngx_http_accounting_module.so;,
请问,这是什么问题呢

Log to file support + buffer overrun check

Added support for (should be in the main conf, just next to http_accounting):
http_accounting_log filename;
Which will write the log data directly to file, instead of using syslog.

Benefits:

  1. Much better performance.
  2. Open/close the log file on every alarm (every 30 seconds). This way the log processing script can safely process the log file, and delete it.
    If you process the result of the accounting module via script, and use syslog to log to file, this becomes problematic as you need to send SIGHUP to make syslog reopen the files (so that you can logrotate). This requires extra permissions for the processing script.
  3. Uses flock() with advisory lock. The processing script also can use flock() to avoid any race conditions.

Also I have added check to limit the variable name contents to 128 characters to fix possible buffer overrun.

Patch:
https://drive.google.com/file/d/0B6Qb_xPKde3gMnFncDFUSHl5QWM/view?usp=sharing

accounting_id should allow variables within a string

This is working:

accounting_id  $http_host;

Result: accounting_id:example.com

But this does not:

accounting_id  http-$http_host;

Result: accounting_id:http-$http_host
Expected result: accounting_id:http-example.com

What's the report page look like?

Hey Lax,

This looks very useful. Could you include a text/html file showing what the accounting report page is, and how to access it? Thanks!

-nick

Keep getting the same error after following the installation steps.

Am still a bit of a noob at using modules in nginx so it might be something stupid that I just don't know about.

nginx: [emerg] dlopen() "/etc/nginx/modules/ngx_http_accounting_module.so" failed (/etc/nginx/modules/ngx_http_accounting_module.so: undefined symbol: ngx_stream_get_variable_index) in /etc/nginx/nginx.conf:1

add-dynamic-module have error

I configure: ./configure --prefix=/data/services/nginx2 --add-dynamic-module=/home/test/traffic-accounting-nginx-module-1.3
it will build the ngx_http_accounting_module.so ,when I copy the so file to other computer,it have an error occurred:
Reloading nginx configuration: nginx: [emerg] module "/data/services/nginx-1.10.2.3/modules/ngx_http_accounting_module.so" is not binary compatible in /data/services/nginx-1.10.2.3/conf/nginx.conf:18
nginx: configuration file /data/services/nginx-1.10.2.3/conf/nginx.conf test failed,is it a bug?

使用单独的统计进程

Posted on Jan 27, 2011 by Massive Ox

现有状况及问题

  1. 设置不通accounting_id较多时,log数量会线性增加。
  2. nginx的worker process较多时(比如超过10个),每分钟的log数量会比较多。

期望的改进 在统计进程中维护计数器,由统计进程进行输出。
当worker process增多时,输出次数不增加

Release 2.0 = signal 17 (SIGCHLD) received

Hi,
After updated the release of this module to 2.0, I obtain signal 17 (SIGCHLD) received

nginx version: nginx/1.15.7
built by gcc 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)
built with OpenSSL 1.1.1c  28 May 2019
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=
/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=
/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_gunzip_module --w
ith-http_gzip_static_module --with-http_mp4_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with
-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-pcre-jit --with-http_geoip_module=dynamic --with-http_image_filter_module=dynamic --with-http_perl_module=dynamic --with-http_xslt_module
=dynamic --add-module=../../SOURCES/headers-more-nginx-module --add-module=../../SOURCES/naxsi/naxsi_src --add-module=../../SOURCES/nchan --add-module=../../SOURCES/nginx_circle_gif --add-module=../../SOURCES/nginx-ct --add-module=../../S
OURCES/nginx-http-rdns --add-module=../../SOURCES/nginx-log-zmq --add-module=../../SOURCES/nginx-openssl-version --add-module=../../SOURCES/nginx-push-stream-module --add-module=../../SOURCES/nginx-upload-progress-module --add-module=../.
./SOURCES/ngx_cache_purge --add-module=../../SOURCES/ngx_brotli --add-module=../../SOURCES/traffic-accounting-nginx-module --add-module=../../SOURCES/ngx_http_auth_pam_module --add-module=../../SOURCES/ngx_http_internal_redirect --add-mod
ule=../../SOURCES/ngx_log_if --add-module=../../SOURCES/ngx-fancyindex --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DT
CP_FASTOPEN=23 -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --with-openssl=../../SOURCES/openssl --with-openssl-opt=enable-tls1_3 --with-debug

Output from error.log :

2019/06/27 04:21:19 [notice] 32881#32881: signal 17 (SIGCHLD) received from 33173
2019/06/27 04:21:19 [alert] 32881#32881: worker process 33173 exited on signal 11
2019/06/27 04:21:19 [debug] 32881#32881: shmtx forced unlock
2019/06/27 04:21:19 [debug] 32881#32881: shmtx forced unlock
2019/06/27 04:21:19 [debug] 32881#32881: shmtx forced unlock
2019/06/27 04:21:19 [debug] 32881#32881: wake up, sigio 0
2019/06/27 04:21:19 [debug] 32881#32881: reap children
2019/06/27 04:21:19 [debug] 32881#32881: child: 0 33173 e:0 t:1 d:0 r:1 j:0
2019/06/27 04:21:19 [debug] 32881#32881: channel 3:9
2019/06/27 04:21:19 [notice] 32881#32881: start worker process 33174
2019/06/27 04:21:19 [debug] 32881#32881: sigsuspend
2019/06/27 04:21:19 [debug] 33174#33174: add cleanup: 00005610D7C8C588
2019/06/27 04:21:19 [debug] 33174#33174: malloc: 00005610D7C7A430:8
2019/06/27 04:21:19 [debug] 33174#33174: notify eventfd: 11
2019/06/27 04:21:19 [debug] 33174#33174: eventfd: 12
2019/06/27 04:21:19 [debug] 33174#33174: testing the EPOLLRDHUP flag: success
2019/06/27 04:21:19 [debug] 33174#33174: malloc: 00005610D7C6AE80:6144
2019/06/27 04:21:19 [debug] 33174#33174: malloc: 00007F18C9C84010:253952
2019/06/27 04:21:19 [debug] 33174#33174: malloc: 00005610D7C90B70:98304
2019/06/27 04:21:19 [debug] 33174#33174: malloc: 00005610D7CA8B80:98304
2019/06/27 04:21:19 [debug] 33174#33174: epoll add event: fd:6 op:1 ev:00002001
2019/06/27 04:21:19 [debug] 33174#33174: REAPER: start reaper memstore message with tick time of 5 sec
2019/06/27 04:21:19 [debug] 33174#33174: REAPER: start reaper memstore nobuffer message with tick time of 2 sec
2019/06/27 04:21:19 [debug] 33174#33174: REAPER: start reaper chanhead with tick time of 4 sec
2019/06/27 04:21:19 [debug] 33174#33174: REAPER: start reaper chanhead churner with tick time of 10 sec
2019/06/27 04:21:19 [debug] 33174#33174: epoll add event: fd:7 op:1 ev:00002001
2019/06/27 04:21:19 [debug] 33174#33174: MEMSTORE:00: init memstore worker pid:33174 slot:0 max workers :1 or 1
2019/06/27 04:21:19 [debug] 33174#33174: shmtx lock
2019/06/27 04:21:19 [debug] 33174#33174: MEMSTORE:00: found my procslot (ngx_process_slot 0, procslot 0)
2019/06/27 04:21:19 [debug] 33174#33174: MEMSTORE:00: shm: 00005610D7C7A350, shdata: 00007F18BAD40000
2019/06/27 04:21:19 [debug] 33174#33174: shmtx unlock
2019/06/27 04:21:19 [debug] 33174#33174: WEBSOCKET_PUBLISHER:init WS publisher llist
2019/06/27 04:21:19 [debug] 33174#33174: malloc: 00005610D7C7A200:152
2019/06/27 04:21:19 [debug] 33174#33174: THINGCACHE: init fd_cache 00005610D7C7A200
2019/06/27 04:21:19 [notice] 32881#32881: signal 17 (SIGCHLD) received from 33174
2019/06/27 04:21:19 [alert] 32881#32881: worker process 33174 exited on signal 11
2019/06/27 04:21:19 [debug] 32881#32881: shmtx forced unlock
2019/06/27 04:21:19 [debug] 32881#32881: shmtx forced unlock
2019/06/27 04:21:19 [debug] 32881#32881: shmtx forced unlock
2019/06/27 04:21:19 [debug] 32881#32881: wake up, sigio 0
2019/06/27 04:21:19 [debug] 32881#32881: reap children
2019/06/27 04:21:19 [debug] 32881#32881: child: 0 33174 e:0 t:1 d:0 r:1 j:0
2019/06/27 04:21:19 [debug] 32881#32881: channel 3:9
2019/06/27 04:21:19 [notice] 32881#32881: start worker process 33175

With the module version 1.2, all are fine :

2019/06/27 04:39:55 [debug] 32650#32650: bind() 0.0.0.0:80 #6
2019/06/27 04:39:55 [notice] 32650#32650: OpenSSL: Built with [OpenSSL 1.1.1c  28 May 2019] runtime is [OpenSSL 1.1.1c  28 May 2019]
2019/06/27 04:39:55 [notice] 32650#32650: using the "epoll" event method
2019/06/27 04:39:55 [debug] 32650#32650: counter: 00007F30F807A080, 1
2019/06/27 04:39:55 [notice] 32650#32650: ngx_http_push_stream_module will not be used with this configuration.
2019/06/27 04:39:55 [notice] 32650#32650: nginx/1.15.7
2019/06/27 04:39:55 [notice] 32650#32650: built by gcc 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)
2019/06/27 04:39:55 [notice] 32650#32650: OS: Linux 4.19.0-5-amd64
2019/06/27 04:39:55 [notice] 32650#32650: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2019/06/27 04:39:55 [debug] 32651#32651: write: 9, 00007FFE6171F9E0, 6, 0
2019/06/27 04:39:55 [debug] 32651#32651: setproctitle: "nginx: master process nginx-debug -c /etc/nginx/nginx.conf"
2019/06/27 04:39:55 [notice] 32651#32651: start worker processes
2019/06/27 04:39:55 [debug] 32651#32651: channel 3:9
2019/06/27 04:39:55 [notice] 32651#32651: start worker process 32652
2019/06/27 04:39:55 [debug] 32651#32651: sigsuspend
2019/06/27 04:39:55 [debug] 32652#32652: add cleanup: 000055CA4A0D0570
2019/06/27 04:39:55 [debug] 32652#32652: malloc: 000055CA4A0BE430:8
2019/06/27 04:39:55 [debug] 32652#32652: notify eventfd: 11
2019/06/27 04:39:55 [debug] 32652#32652: eventfd: 12
2019/06/27 04:39:55 [debug] 32652#32652: testing the EPOLLRDHUP flag: success
2019/06/27 04:39:55 [debug] 32652#32652: malloc: 000055CA4A0AEE80:6144
2019/06/27 04:39:55 [debug] 32652#32652: malloc: 00007F30F8016010:253952
2019/06/27 04:39:55 [debug] 32652#32652: malloc: 000055CA4A0D4B70:98304
2019/06/27 04:39:55 [debug] 32652#32652: malloc: 000055CA4A0ECB80:98304
2019/06/27 04:39:55 [debug] 32652#32652: epoll add event: fd:6 op:1 ev:00002001
2019/06/27 04:39:55 [debug] 32652#32652: REAPER: start reaper memstore message with tick time of 5 sec
2019/06/27 04:39:55 [debug] 32652#32652: REAPER: start reaper memstore nobuffer message with tick time of 2 sec
2019/06/27 04:39:55 [debug] 32652#32652: REAPER: start reaper chanhead with tick time of 4 sec
2019/06/27 04:39:55 [debug] 32652#32652: REAPER: start reaper chanhead churner with tick time of 10 sec
2019/06/27 04:39:55 [debug] 32652#32652: epoll add event: fd:7 op:1 ev:00002001
2019/06/27 04:39:55 [debug] 32652#32652: MEMSTORE:00: init memstore worker pid:32652 slot:0 max workers :1 or 1
2019/06/27 04:39:55 [debug] 32652#32652: shmtx lock
2019/06/27 04:39:55 [debug] 32652#32652: MEMSTORE:00: found my procslot (ngx_process_slot 0, procslot 0)
2019/06/27 04:39:55 [debug] 32652#32652: MEMSTORE:00: shm: 000055CA4A0BE350, shdata: 00007F30E90D2000
2019/06/27 04:39:55 [debug] 32652#32652: shmtx unlock
2019/06/27 04:39:55 [debug] 32652#32652: WEBSOCKET_PUBLISHER:init WS publisher llist
2019/06/27 04:39:55 [debug] 32652#32652: malloc: 000055CA4A0BE200:152
2019/06/27 04:39:55 [debug] 32652#32652: THINGCACHE: init fd_cache 000055CA4A0BE200
2019/06/27 04:39:55 [debug] 32652#32652: epoll add event: fd:9 op:1 ev:00002001
2019/06/27 04:39:55 [debug] 32652#32652: setproctitle: "nginx: worker process"
2019/06/27 04:39:55 [debug] 32652#32652: worker cycle
2019/06/27 04:39:55 [debug] 32652#32652: epoll timer: -1

Have you any idea how to fix it ?

Regards

Invalid ELF header error when loading module

This is my nginx environment

  • yum install nginx
# nginx -V
nginx version: nginx/1.20.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.1.1g FIPS  21 Apr 2020 (running with OpenSSL 1.1.1k  FIPS 25 Mar 2021)
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-compat --with-debug --with-file-aio --with-google_perftools_module --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_perl_module=dynamic --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
  • nginx.conf
load_module modules/ngx_http_accounting_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# ...

And I put the so module under /usr/share/nginx/modules. But when I execute nginx -s reload, the following error is reported

nginx: [emerg] dlopen() "/usr/share/nginx/modules/ngx_http_accounting_module.so" failed (/usr/share/nginx/modules/ngx_http_accounting_module.so: invalid ELF header) in /etc/nginx/nginx.conf:5

so, Please help me see what happened and this issus how to solve, thanks a lot~

compile fails with nginx 1.0.3

Looks like the code needs to be updated to match the latest sources.
Build log below.
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -g -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/modules/perl -I src/mail
-o objs/addon/ngx_http_accounting_module/ngx_http_accounting_status_code.o
ngx_http_accounting_module/ngx_http_accounting_status_code.c
ngx_http_accounting_module/ngx_http_accounting_module.c: In function 'ngx_http_accounting_init_main_conf':
ngx_http_accounting_module/ngx_http_accounting_module.c:127: warning: unused parameter 'cf'
ngx_http_accounting_module/ngx_http_accounting_module.c: In function 'ngx_http_accounting_merge_loc_conf':
ngx_http_accounting_module/ngx_http_accounting_module.c:154: warning: unused parameter 'cf'
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -g -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/modules/perl -I src/mail
-o objs/addon/ngx_http_accounting_module/ngx_http_accounting_worker_process.o
ngx_http_accounting_module/ngx_http_accounting_worker_process.c
ngx_http_accounting_module/ngx_http_accounting_status_code.c: In function 'init_http_status_code_map':
ngx_http_accounting_module/ngx_http_accounting_status_code.c:99: error: 'NGX_HTTP_OWN_CODES' undeclared (first use in this function)
ngx_http_accounting_module/ngx_http_accounting_status_code.c:99: error: (Each undeclared identifier is reported only once
ngx_http_accounting_module/ngx_http_accounting_status_code.c:99: error: for each function it appears in.)
make[1]: *** [objs/addon/ngx_http_accounting_module/ngx_http_accounting_status_code.o] Error 1
make[1]: *** Waiting for unfinished jobs....
ngx_http_accounting_module/ngx_http_accounting_worker_process.c: In function 'worker_process_write_out_stats':
ngx_http_accounting_module/ngx_http_accounting_worker_process.c:130: warning: unused parameter 'len'
ngx_http_accounting_module/ngx_http_accounting_worker_process.c:130: warning: unused parameter 'para1'
ngx_http_accounting_module/ngx_http_accounting_worker_process.c:130: warning: unused parameter 'para2'
make[1]: Leaving directory `/builddir/build/BUILD/nginx-1.0.3'

mean of these parameter in syslog file

Mar 23 15:38:09 NgxAccounting: pid:22482|from:1427099859|to:1427099889|accounting_id:default|requests:421|bytes_in:109135|bytes_out:1243987403|200:2|206:419

I don't know what are they: From (where?), to (where?) accounting_id, request for what and bytes_in. byte_out and 200:2|206:419

So could you please give me a doc of this module and how to use this?Thanks in advanced

Issues when loading as dynamic module on macOS

I just compiled the module as a dynamic module on macOS (nginx 1.19.7 installed via Homebrew) and when I add the load_module directive in nginx.conf and start the server, the error log gets flooded with the following errors (with high CPU utilization):

2021/02/28 11:05:10 [alert] 42874#0: worker process 49555 exited on signal 11
2021/02/28 11:05:10 [alert] 42874#0: cache manager process 49558 exited on signal 11

Turning on debug logging produces the following (repeatedly):

2021/02/28 11:17:04 [debug] 81313#0: bind() 127.0.0.1:3333 #7
2021/02/28 11:17:04 [debug] 81313#0: bind() 0.0.0.0:80 #8
2021/02/28 11:17:04 [debug] 81313#0: bind() 0.0.0.0:443 #9
2021/02/28 11:17:04 [notice] 81313#0: using the "kqueue" event method
2021/02/28 11:17:04 [warn] 81313#0: 1024 worker_connections exceed open file resource limit: 256
2021/02/28 11:17:04 [debug] 81313#0: counter: 000000010396D080, 1
2021/02/28 11:17:04 [notice] 81313#0: nginx/1.19.7
2021/02/28 11:17:04 [notice] 81313#0: built by clang 12.0.0 (clang-1200.0.32.29)
2021/02/28 11:17:04 [notice] 81313#0: OS: Darwin 20.3.0
2021/02/28 11:17:04 [notice] 81313#0: hw.ncpu: 8
2021/02/28 11:17:04 [notice] 81313#0: net.inet.tcp.sendspace: 131072
2021/02/28 11:17:04 [notice] 81313#0: kern.ipc.somaxconn: 128
2021/02/28 11:17:04 [notice] 81313#0: getrlimit(RLIMIT_NOFILE): 256:9223372036854775807
2021/02/28 11:17:04 [debug] 81313#0: write: 10, 00007FFEEC455A70, 6, 0
2021/02/28 11:17:04 [debug] 81313#0: setproctitle: "nginx: master process /usr/local/opt/nginx/bin/nginx -g daemon off;"
2021/02/28 11:17:04 [notice] 81313#0: start worker processes
2021/02/28 11:17:04 [debug] 81313#0: channel 3:10
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81326
2021/02/28 11:17:04 [debug] 81313#0: channel 11:12
2021/02/28 11:17:04 [debug] 81326#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81326#0: malloc: 00007F92DE704290:8
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81327
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81327 fd:11 to s:0 pid:81326 fd:3
2021/02/28 11:17:04 [debug] 81313#0: channel 13:14
2021/02/28 11:17:04 [debug] 81327#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81327#0: malloc: 00007F92DF004340:8
2021/02/28 11:17:04 [notice] 81313#0: start cache manager process 81328
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81328 fd:13 to s:0 pid:81326 fd:3
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81328 fd:13 to s:1 pid:81327 fd:11
2021/02/28 11:17:04 [debug] 81313#0: channel 15:16
2021/02/28 11:17:04 [debug] 81328#0: close listening 127.0.0.1:3333 #7
2021/02/28 11:17:04 [notice] 81313#0: start cache loader process 81330
2021/02/28 11:17:04 [debug] 81328#0: close listening 0.0.0.0:80 #8
2021/02/28 11:17:04 [debug] 81328#0: close listening 0.0.0.0:443 #9
2021/02/28 11:17:04 [debug] 81328#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81328#0: malloc: 00007F92DE6040A0:8
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:3 pid:81330 fd:15 to s:0 pid:81326 fd:3
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:3 pid:81330 fd:15 to s:1 pid:81327 fd:11
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:3 pid:81330 fd:15 to s:2 pid:81328 fd:13
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [debug] 81330#0: close listening 127.0.0.1:3333 #7
2021/02/28 11:17:04 [debug] 81330#0: close listening 0.0.0.0:80 #8
2021/02/28 11:17:04 [debug] 81330#0: close listening 0.0.0.0:443 #9
2021/02/28 11:17:04 [debug] 81330#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81330#0: malloc: 00007F92DF004390:8
2021/02/28 11:17:04 [debug] 81326#0: malloc: 00007F92E80DC800:16384
2021/02/28 11:17:04 [debug] 81326#0: malloc: 00007F92E800C600:16384
2021/02/28 11:17:04 [debug] 81327#0: malloc: 00007F92CF808200:16384
2021/02/28 11:17:04 [debug] 81327#0: malloc: 00007F92E8811A00:16384
2021/02/28 11:17:04 [debug] 81326#0: malloc: 00007F92C0008000:237568
2021/02/28 11:17:04 [debug] 81327#0: malloc: 00007F92C0008000:237568
2021/02/28 11:17:04 [debug] 81327#0: malloc: 00007F92C0048000:106496
2021/02/28 11:17:04 [debug] 81326#0: malloc: 00007F92B0008000:106496
2021/02/28 11:17:04 [debug] 81327#0: malloc: 00007F92C0068000:106496
2021/02/28 11:17:04 [debug] 81326#0: malloc: 00007F92B8008000:106496
2021/02/28 11:17:04 [debug] 81328#0: malloc: 00007F92CF808200:16384
2021/02/28 11:17:04 [debug] 81328#0: malloc: 00007F92CF80C200:16384
2021/02/28 11:17:04 [debug] 81327#0: kevent set event: 7: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81326#0: kevent set event: 7: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81326#0: kevent set event: 8: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81326#0: kevent set event: 9: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81327#0: kevent set event: 8: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81328#0: malloc: 00007F92C0008000:118784
2021/02/28 11:17:04 [debug] 81327#0: kevent set event: 9: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81328#0: malloc: 00007F92B0008000:53248
2021/02/28 11:17:04 [debug] 81328#0: malloc: 00007F92C0028000:53248
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81326
2021/02/28 11:17:04 [alert] 81313#0: worker process 81327 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [alert] 81313#0: worker process 81326 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81330#0: malloc: 00007F92E8811A00:16384
2021/02/28 11:17:04 [debug] 81330#0: malloc: 00007F92E8815A00:16384
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81330#0: malloc: 00007F92C0008000:118784
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81330#0: malloc: 00007F92E0008000:53248
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81326 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:0 pid:81326 to:81328
2021/02/28 11:17:04 [debug] 81330#0: malloc: 00007F92E0018000:53248
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:0 pid:81326 to:81330
2021/02/28 11:17:04 [debug] 81313#0: channel 3:10
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81334
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81334 fd:3 to s:1 pid:81327 fd:11
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81334 fd:3 to s:2 pid:81328 fd:13
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81334 fd:3 to s:3 pid:81330 fd:15
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81327 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:1 pid:81327 to:81334
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:1 pid:81327 to:81328
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:1 pid:81327 to:81330
2021/02/28 11:17:04 [debug] 81313#0: channel 11:12
2021/02/28 11:17:04 [debug] 81334#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81334#0: malloc: 00007F92DE407CA0:8
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81335
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81335 fd:11 to s:0 pid:81334 fd:3
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81335 fd:11 to s:2 pid:81328 fd:13
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81335 fd:11 to s:3 pid:81330 fd:15
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81328 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 3 81330 e:0 t:0 d:0 r:0 j:0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81330
2021/02/28 11:17:04 [alert] 81313#0: cache loader process 81330 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [alert] 81313#0: cache manager process 81328 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81334 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81335 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81328 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:2 pid:81328 to:81334
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:2 pid:81328 to:81335
2021/02/28 11:17:04 [debug] 81313#0: channel 13:14
2021/02/28 11:17:04 [debug] 81335#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81335#0: malloc: 00007F92DF1175D0:8
2021/02/28 11:17:04 [notice] 81313#0: start cache manager process 81336
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81336 fd:13 to s:0 pid:81334 fd:3
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81336 fd:13 to s:1 pid:81335 fd:11
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81336 fd:13 to s:3 pid:81330 fd:15
2021/02/28 11:17:04 [debug] 81313#0: child: 3 81330 e:0 t:1 d:0 r:0 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:3 pid:81330 to:81334
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:3 pid:81330 to:81335
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:3 pid:81330 to:81336
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [debug] 81336#0: close listening 127.0.0.1:3333 #7
2021/02/28 11:17:04 [debug] 81336#0: close listening 0.0.0.0:80 #8
2021/02/28 11:17:04 [debug] 81336#0: close listening 0.0.0.0:443 #9
2021/02/28 11:17:04 [debug] 81336#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81336#0: malloc: 00007F92DF004330:8
2021/02/28 11:17:04 [debug] 81334#0: malloc: 00007F92E8811A00:16384
2021/02/28 11:17:04 [debug] 81334#0: malloc: 00007F92E8815A00:16384
2021/02/28 11:17:04 [debug] 81334#0: malloc: 00007F92C0008000:237568
2021/02/28 11:17:04 [debug] 81334#0: malloc: 00007F92C0048000:106496
2021/02/28 11:17:04 [debug] 81334#0: malloc: 00007F92C0068000:106496
2021/02/28 11:17:04 [debug] 81335#0: malloc: 00007F92CF008200:16384
2021/02/28 11:17:04 [debug] 81335#0: malloc: 00007F92CF00C200:16384
2021/02/28 11:17:04 [debug] 81335#0: malloc: 00007F92C0008000:237568
2021/02/28 11:17:04 [debug] 81335#0: malloc: 00007F92C0048000:106496
2021/02/28 11:17:04 [debug] 81334#0: kevent set event: 7: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81334#0: kevent set event: 8: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81334#0: kevent set event: 9: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81335#0: malloc: 00007F92C0068000:106496
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received from 81334
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [debug] 81335#0: kevent set event: 7: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81335#0: kevent set event: 8: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81335#0: kevent set event: 9: ft:-1 fl:0005
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81334
2021/02/28 11:17:04 [alert] 81313#0: worker process 81334 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81334 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:0 pid:81334 to:81335
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:0 pid:81334 to:81336
2021/02/28 11:17:04 [debug] 81313#0: channel 3:10
2021/02/28 11:17:04 [debug] 81336#0: malloc: 00007F92E8811A00:16384
2021/02/28 11:17:04 [debug] 81336#0: malloc: 00007F92E8815A00:16384
2021/02/28 11:17:04 [debug] 81336#0: malloc: 00007F92C0008000:118784
2021/02/28 11:17:04 [debug] 81336#0: malloc: 00007F92C0028000:53248
2021/02/28 11:17:04 [debug] 81336#0: malloc: 00007F92C0038000:53248
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81338
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81338 fd:3 to s:1 pid:81335 fd:11
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81338 fd:3 to s:2 pid:81336 fd:13
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81335 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81336 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [debug] 81338#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81338#0: malloc: 00007F92DE704290:8
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81336
2021/02/28 11:17:04 [alert] 81313#0: cache manager process 81336 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [alert] 81313#0: worker process 81335 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81338 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81335 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:1 pid:81335 to:81338
2021/02/28 11:17:04 [debug] 81313#0: channel 11:12
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81339
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81339 fd:11 to s:0 pid:81338 fd:3
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81339 fd:11 to s:2 pid:81336 fd:13
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81336 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:2 pid:81336 to:81338
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:2 pid:81336 to:81339
2021/02/28 11:17:04 [debug] 81313#0: channel 13:14
2021/02/28 11:17:04 [debug] 81339#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81339#0: malloc: 00007F92DF004390:8
2021/02/28 11:17:04 [debug] 81338#0: malloc: 00007F92CF808200:16384
2021/02/28 11:17:04 [debug] 81338#0: malloc: 00007F92CF80C200:16384
2021/02/28 11:17:04 [debug] 81338#0: malloc: 00007F92C0008000:237568
2021/02/28 11:17:04 [debug] 81338#0: malloc: 00007F92C0048000:106496
2021/02/28 11:17:04 [debug] 81338#0: malloc: 00007F92C0068000:106496
2021/02/28 11:17:04 [debug] 81338#0: kevent set event: 7: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81338#0: kevent set event: 8: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81338#0: kevent set event: 9: ft:-1 fl:0005
2021/02/28 11:17:04 [notice] 81313#0: start cache manager process 81340
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81340 fd:13 to s:0 pid:81338 fd:3
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81340 fd:13 to s:1 pid:81339 fd:11
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81338
2021/02/28 11:17:04 [alert] 81313#0: worker process 81338 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81338 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:0 pid:81338 to:81339
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:0 pid:81338 to:81340
2021/02/28 11:17:04 [debug] 81340#0: close listening 127.0.0.1:3333 #7
2021/02/28 11:17:04 [debug] 81313#0: channel 3:10
2021/02/28 11:17:04 [debug] 81339#0: malloc: 00007F92CF008200:16384
2021/02/28 11:17:04 [debug] 81339#0: malloc: 00007F92CF00C200:16384
2021/02/28 11:17:04 [debug] 81340#0: close listening 0.0.0.0:80 #8
2021/02/28 11:17:04 [debug] 81339#0: malloc: 00007F92C0008000:237568
2021/02/28 11:17:04 [debug] 81339#0: malloc: 00007F92C0048000:106496
2021/02/28 11:17:04 [debug] 81340#0: close listening 0.0.0.0:443 #9
2021/02/28 11:17:04 [debug] 81339#0: malloc: 00007F92C0068000:106496
2021/02/28 11:17:04 [debug] 81340#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81340#0: malloc: 00007F92DF1175D0:8
2021/02/28 11:17:04 [debug] 81339#0: kevent set event: 7: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81339#0: kevent set event: 8: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81339#0: kevent set event: 9: ft:-1 fl:0005
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81342
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81342 fd:3 to s:1 pid:81339 fd:11
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81342 fd:3 to s:2 pid:81340 fd:13
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81339 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81340 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81339
2021/02/28 11:17:04 [alert] 81313#0: worker process 81339 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81342 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81339 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:1 pid:81339 to:81342
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:1 pid:81339 to:81340
2021/02/28 11:17:04 [debug] 81313#0: channel 11:12
2021/02/28 11:17:04 [debug] 81342#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81342#0: malloc: 00007F92DE6040A0:8
2021/02/28 11:17:04 [debug] 81340#0: malloc: 00007F92CF808200:16384
2021/02/28 11:17:04 [debug] 81340#0: malloc: 00007F92CF80C200:16384
2021/02/28 11:17:04 [debug] 81340#0: malloc: 00007F92C0008000:118784
2021/02/28 11:17:04 [debug] 81340#0: malloc: 00007F92C0028000:53248
2021/02/28 11:17:04 [debug] 81340#0: malloc: 00007F92C0038000:53248
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81344
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81344 fd:11 to s:0 pid:81342 fd:3
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81344 fd:11 to s:2 pid:81340 fd:13
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81340 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received from 81340
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81340
2021/02/28 11:17:04 [alert] 81313#0: cache manager process 81340 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81344#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81342 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81344 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81340 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:2 pid:81340 to:81342
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:2 pid:81340 to:81344
2021/02/28 11:17:04 [debug] 81344#0: malloc: 00007F92DE407CA0:8
2021/02/28 11:17:04 [debug] 81313#0: channel 13:14
2021/02/28 11:17:04 [debug] 81342#0: malloc: 00007F92DF82CE00:16384
2021/02/28 11:17:04 [debug] 81342#0: malloc: 00007F92DF830E00:16384
2021/02/28 11:17:04 [debug] 81342#0: malloc: 00007F92C0008000:237568
2021/02/28 11:17:04 [debug] 81342#0: malloc: 00007F92C0048000:106496
2021/02/28 11:17:04 [debug] 81342#0: malloc: 00007F92C0068000:106496
2021/02/28 11:17:04 [debug] 81342#0: kevent set event: 7: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81342#0: kevent set event: 8: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81342#0: kevent set event: 9: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81344#0: malloc: 00007F92CF008200:16384
2021/02/28 11:17:04 [debug] 81344#0: malloc: 00007F92CF00C200:16384
2021/02/28 11:17:04 [debug] 81344#0: malloc: 00007F92C0008000:237568
2021/02/28 11:17:04 [debug] 81344#0: malloc: 00007F92C0048000:106496
2021/02/28 11:17:04 [notice] 81313#0: start cache manager process 81346
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81346 fd:13 to s:0 pid:81342 fd:3
2021/02/28 11:17:04 [debug] 81344#0: malloc: 00007F92C0068000:106496
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:2 pid:81346 fd:13 to s:1 pid:81344 fd:11
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81342
2021/02/28 11:17:04 [alert] 81313#0: worker process 81342 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81344#0: kevent set event: 7: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81344#0: kevent set event: 8: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81344#0: kevent set event: 9: ft:-1 fl:0005
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81342 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:0 pid:81342 to:81344
2021/02/28 11:17:04 [debug] 81346#0: close listening 127.0.0.1:3333 #7
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:0 pid:81342 to:81346
2021/02/28 11:17:04 [debug] 81346#0: close listening 0.0.0.0:80 #8
2021/02/28 11:17:04 [debug] 81346#0: close listening 0.0.0.0:443 #9
2021/02/28 11:17:04 [debug] 81313#0: channel 3:10
2021/02/28 11:17:04 [debug] 81346#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81346#0: malloc: 00007F92DF1175D0:8
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81348
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81348 fd:3 to s:1 pid:81344 fd:11
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:0 pid:81348 fd:3 to s:2 pid:81346 fd:13
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81344 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81346 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81344
2021/02/28 11:17:04 [alert] 81313#0: worker process 81344 exited on signal 11
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: shmtx forced unlock
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: reap children
2021/02/28 11:17:04 [debug] 81313#0: child: 0 81348 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81348#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81348#0: malloc: 00007F92DE6040A0:8
2021/02/28 11:17:04 [debug] 81313#0: child: 1 81344 e:0 t:1 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:1 pid:81344 to:81348
2021/02/28 11:17:04 [debug] 81313#0: pass close channel s:1 pid:81344 to:81346
2021/02/28 11:17:04 [debug] 81313#0: channel 11:12
2021/02/28 11:17:04 [debug] 81346#0: malloc: 00007F92CE808600:16384
2021/02/28 11:17:04 [debug] 81346#0: malloc: 00007F92CE80C600:16384
2021/02/28 11:17:04 [notice] 81313#0: start worker process 81350
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81350 fd:11 to s:0 pid:81348 fd:3
2021/02/28 11:17:04 [debug] 81313#0: pass channel s:1 pid:81350 fd:11 to s:2 pid:81346 fd:13
2021/02/28 11:17:04 [debug] 81313#0: child: 2 81346 e:0 t:0 d:0 r:1 j:0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [debug] 81346#0: malloc: 00007F92C0008000:118784
2021/02/28 11:17:04 [debug] 81346#0: malloc: 00007F92B0008000:53248
2021/02/28 11:17:04 [debug] 81346#0: malloc: 00007F92B0018000:53248
2021/02/28 11:17:04 [debug] 81350#0: add cleanup: 00007F92E80DB508
2021/02/28 11:17:04 [debug] 81350#0: malloc: 00007F92DF1175D0:8
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received from 81346
2021/02/28 11:17:04 [debug] 81313#0: wake up, sigio 0
2021/02/28 11:17:04 [debug] 81313#0: sigsuspend
2021/02/28 11:17:04 [notice] 81313#0: signal 23 (SIGIO) received
2021/02/28 11:17:04 [notice] 81313#0: signal 20 (SIGCHLD) received from 81346
2021/02/28 11:17:04 [alert] 81313#0: cache manager process 81346 exited on signal 11

Any ideas?

NGINX 1.16.1 - dynamic module keeps crashing ( segfault )

Hello, I've compiled the dynamic module with same flags as installed nginx binary but after loading the accounting module nginx keeps crashing.

Any hints? Is it possible to publish prebuild binaries for the NGINX version 1.16.1 ?

systemctl status nginx.service

kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 
kernel: nginx[572]: segfault at 0 ip 00007f725667a1b2 sp 00007fff7df3ba68 error 4 in ngx_http_accounting_module.so[7f725667a000+2000]
kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 
kernel: nginx[574]: segfault at 0 ip 00007f725667a1b2 sp 00007fff7df3ba68 error 4 in ngx_http_accounting_module.so[7f725667a000+2000]
kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 
kernel: nginx[576]: segfault at 0 ip 00007f725667a1b2 sp 00007fff7df3ba68 error 4 in ngx_http_accounting_module.so[7f725667a000+2000]
kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 
kernel: nginx[578]: segfault at 0 ip 00007f725667a1b2 sp 00007fff7df3ba68 error 4 in ngx_http_accounting_module.so[7f725667a000+2000]
kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 
kernel: nginx[580]: segfault at 0 ip 00007f725667a1b2 sp 00007fff7df3ba68 error 4 in ngx_http_accounting_module.so[7f725667a000+2000]
kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 
kernel: nginx[582]: segfault at 0 ip 00007f725667a1b2 sp 00007fff7df3ba68 error 4 in ngx_http_accounting_module.so[7f725667a000+2000]
kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 
kernel: nginx[584]: segfault at 0 ip 00007f725667a1b2 sp 00007fff7df3ba68 error 4 in ngx_http_accounting_module.so[7f725667a000+2000]
kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 
kernel: nginx[586]: segfault at 0 ip 00007f725667a1b2 sp 00007fff7df3ba68 error 4 in ngx_http_accounting_module.so[7f725667a000+2000]
kernel: Code: 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 08 00 00 00 0f 0b <48> 8b 04 25 00 00 00 00 0f 0b 48 8b 04 25 20 00 00 00 0f 0b 48

/var/log/nginx/error.log

2019/11/19 23:05:42 [alert] 31669#31669: worker process 32054 exited on signal 11 (core dumped)
2019/11/19 23:05:42 [alert] 31669#31669: worker process 32056 exited on signal 11 (core dumped)
2019/11/19 23:05:42 [alert] 31669#31669: worker process 32058 exited on signal 11 (core dumped)
2019/11/19 23:05:42 [alert] 31669#31669: worker process 32060 exited on signal 11 (core dumped)
2019/11/19 23:05:42 [alert] 31669#31669: worker process 32062 exited on signal 11 (core dumped)
2019/11/19 23:05:42 [alert] 31669#31669: worker process 32064 exited on signal 11 (core dumped)
2019/11/19 23:05:43 [alert] 31669#31669: worker process 32066 exited on signal 11 (core dumped)
2019/11/19 23:05:43 [alert] 31669#31669: worker process 32068 exited on signal 11 (core dumped)
2019/11/19 23:05:43 [alert] 31669#31669: worker process 32070 exited on signal 11 (core dumped)
2019/11/19 23:05:43 [alert] 31669#31669: worker process 32072 exited on signal 11 (core dumped)

accounting.log

2019/11/19 22:49:38 [notice] 10043#10043: pid:10043|start http traffic accounting
2019/11/19 22:49:38 [notice] 10045#10045: pid:10045|start http traffic accounting
2019/11/19 22:49:38 [notice] 10047#10047: pid:10047|start http traffic accounting
2019/11/19 22:49:38 [notice] 10049#10049: pid:10049|start http traffic accounting
2019/11/19 22:49:38 [notice] 10051#10051: pid:10051|start http traffic accounting
2019/11/19 22:49:38 [notice] 10053#10053: pid:10053|start http traffic accounting
2019/11/19 22:49:38 [notice] 10055#10055: pid:10055|start http traffic accounting
2019/11/19 22:49:38 [notice] 10057#10057: pid:10057|start http traffic accounting
2019/11/19 22:49:38 [notice] 10059#10059: pid:10059|start http traffic accounting
2019/11/19 22:49:38 [notice] 10061#10061: pid:10061|start http traffic accounting
2019/11/19 22:49:38 [notice] 10063#10063: pid:10063|start http traffic accounting
2019/11/19 22:49:38 [notice] 10065#10065: pid:10065|start http traffic accounting

bytes_in is not used

First all, thanks for sharing the module. It is very useful

I can see bytes_out is used in code and is working fine . ( stats->bytes_out += r->connection->sent;)

But how to calculate bytes_in? any clue? I checked ngx_http_request_s & ngx_connection_s which has 'sent' data but not the receive data. Any suggestion would be really helpful

Thanks

Constant crashing

Hello, I had to compile the module for nginx version 1.17.7 and after i add the directive accounting on; it starts to start and kill workers:

`2022/01/12 13:25:25 [alert] 1#1: worker process 452 exited on signal 11
2022/01/12 13:25:25 [notice] 1#1: start worker process 453
2022/01/12 13:25:25 [notice] 1#1: signal 29 (SIGIO) received
2022/01/12 13:25:25 [notice] 1#1: signal 29 (SIGIO) received
2022/01/12 13:25:25 [notice] 1#1: signal 17 (SIGCHLD) received from 451
2022/01/12 13:25:25 [alert] 1#1: worker process 451 exited on signal 11
2022/01/12 13:25:25 [notice] 1#1: start worker process 454
....
`

i used the ./configuration from issue #42 changing the version to 17.7 but it still crushes.
My nginx -V

`nginx version: nginx/1.17.7
built by gcc 9.3.0 (Alpine 9.3.0)
built with OpenSSL 1.1.1j  16 Feb 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --pid-path=/usr/local/nginx/logs/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-ld-opt=-Wl,-rpath,/usr/lib --user=nginx --group=nginx --with-pcre-jit --add-module=/tmp/tmp.BcBLcl/nginx_upstream_check_module-0.3.0 --add-module=/tmp/tmp.BcBLcl/ngx_devel_kit-0.3.1 --add-module=/tmp/tmp.BcBLcl/lua-nginx-module-0.10.15 --add-module=/tmp/tmp.BcBLcl/spnego-http-auth-nginx-module-1.1.0 --with-http_ssl_module --with-stream_ssl_module --with-http_sub_module --with-stream --with-threads --with-http_realip_module --with-file-aio --with-http_auth_request_module --with-compat --with-http_stub_status_module --with-http_v2_module`

I also tryed to compile the module with these options but it starts crushing with load-module,

issue with dynamic building: "no suitable image found"

What happened?

followed instructions in readme - i included load_module modules/ngx_http_accounting_module.so; at the top level of my nginx.conf file, and added the downloaded .so file from releases in my /modules folder.

However, I run into an error "no suitable image found". Any ideas?

ENV: Im on a macbook, installed nginx with homebrew

Error:

nginx: [emerg] dlopen() "/usr/local/Cellar/nginx/1.17.8/modules/ngx_http_accounting_module.so" failed (dlopen(/usr/local/Cellar/nginx/1.17.8/modules/ngx_http_accounting_module.so, 10): no suitable image found.  Did find:
	/usr/local/Cellar/nginx/1.17.8/modules/ngx_http_accounting_module.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
	/usr/local/Cellar/nginx/1.17.8/modules/ngx_http_accounting_module.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00) in /usr/local/etc/nginx/nginx.conf:1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.