Skip to content

Commit

Permalink
Update docs for release v2.0 (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lax authored May 28, 2019
1 parent 712cf7f commit 7c4c13b
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Monitor the incoming and outgoing traffic metrics in realtime for `NGINX`.

**Now accounting module supports both HTTP and STREAM subsystems**

Realtime traffic and status code monitor solution for NGINX,
need less memory and cpu than realtime log analyzing solutions.
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](https://app.fossa.io/api/projects/git%2Bgithub.com%2FLax%2Ftraffic-accounting-nginx-module.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FLax%2Ftraffic-accounting-nginx-module?ref=badge_shield)
Expand All @@ -16,16 +16,16 @@ Realtime log analysis solutions,
which requires multiple machines for storage and analysis,
are too heavy for application monitoring.

An cost-effective solution is needed to monitor the traffic metrics/status of application requests.
That solution should be accurate, sensitive, robust, light weight enough, and not affected by traffic peaks.
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?

The module keeps in its context a list of **metrics** identified by `accounting_id`.
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 every period (defined by `interval`), a timer event is triggered, those metrics are rotated and exported to log files or sent to remote log servers.
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.


---
Expand All @@ -39,7 +39,6 @@ Add following lines at the beginning of `nginx.conf`:

```
load_module modules/ngx_http_accounting_module.so;
load_module modules/ngx_stream_accounting_module.so;
```

Reload nginx config with `nginx -s reload`. *Done!*
Expand Down Expand Up @@ -226,10 +225,20 @@ 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
make && make install
# 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)
Expand All @@ -238,7 +247,9 @@ Add the following lines at the beginning of `nginx.conf`:

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

### Step 3
Expand Down

0 comments on commit 7c4c13b

Please sign in to comment.