82 |
82 |
83 * [-q|--quiet]: Quiet mode. No output at all. Ignored if -d is supplied. |
83 * [-q|--quiet]: Quiet mode. No output at all. Ignored if -d is supplied. |
84 * [-d|--debug]: Debug mode. Show incoming data. |
84 * [-d|--debug]: Debug mode. Show incoming data. |
85 * [--dbopts]: PostgreSQL connection information. (See below for more details.) |
85 * [--dbopts]: PostgreSQL connection information. (See below for more details.) |
86 * [-h|--help]: Display quick help text. |
86 * [-h|--help]: Display quick help text. |
87 * [--listen-addr]: A specific IP address to listen on. Defaults to INADDR_ANY. |
87 * [--listen-addr]: A specific IP address to listen on. Defaults to **INADDR_ANY**. |
88 * [--listen-port]: The port to listen for netdata JSON streams. |
88 * [--listen-port]: The port to listen for netdata JSON streams. |
89 Default is 14866. |
89 Default is **14866**. |
90 * [-T|--dbtable]: Change the table name to insert to. Defaults to **netdata**. |
90 * [-T|--dbtable]: Change the table name to insert to. Defaults to **netdata**. |
91 * [-t|--timeout]: Maximum time in milliseconds to wait for data. Slow |
91 * [-t|--timeout]: Maximum time in milliseconds to wait for data. Slow |
92 connections may need to increase this from the default 500 ms. |
92 connections may need to increase this from the default **500** ms. |
93 * [-v|--version]: Show version. |
93 * [-v|--version]: Show version. |
94 |
94 |
95 |
95 |
96 **Notes** |
96 **Notes** |
97 |
97 |
98 Nim option parsing might be slightly different than what you're used to. |
98 Nim option parsing might be slightly different than what you're used to. |
99 Flags that require arguments must include an '=' or ':' character. |
99 Flags that require arguments must include an '=' or ':' character. |
100 |
100 |
101 * --timeout=1000 *valid* |
101 * --timeout=1000 *valid* |
102 * --timeout:1000 *valid* |
102 * --timeout:1000 *valid* |
103 * --t:1000 *valid* |
103 * -t:1000 *valid* |
104 * --timeout 1000 *invalid* |
104 * --timeout 1000 *invalid* |
105 * -t 1000 *invalid* |
105 * -t 1000 *invalid* |
106 |
106 |
107 All database connection options are passed as a key/val string to the |
107 All database connection options are passed as a key/val string to the |
108 *dbopts* flag. The default is: |
108 *dbopts* flag. The default is: |
109 |
109 |
110 "host=localhost port=5432 dbname=netdata user=netdata application_name=netdata-tsrelay" |
110 "host=localhost port=5432 dbname=netdata user=netdata application_name=netdata-tsrelay" |
111 |
111 |
112 Reference |
112 Reference the [PostgreSQL |
113 https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ- |
113 Documentation](https://www.postgresql.org/docs/current/static/libpq-conn |
114 PARAMKEYWORDS for all available options (including how to store |
114 ect.html#LIBPQ-PARAMKEYWORDS) for all available options (including how |
115 passwords in a seperate file, enable SSL mode, etc.) |
115 to store passwords in a separate file, enable SSL mode, etc.) |
116 |
116 |
117 |
117 |
118 ### Daemonizing |
118 ### Daemonizing |
119 |
119 |
120 Use a tool of your choice to run this at system |
120 Use a tool of your choice to run this at system |
130 -p /var/run/netdata_tsrelay.pid \ |
130 -p /var/run/netdata_tsrelay.pid \ |
131 -u nobody -cr \ |
131 -u nobody -cr \ |
132 /usr/local/bin/netdata_tsrelay \ |
132 /usr/local/bin/netdata_tsrelay \ |
133 --dbopts="dbname=metrics user=metrics host=db-master port=6432 application_name=netdata-tsrelay" |
133 --dbopts="dbname=metrics user=metrics host=db-master port=6432 application_name=netdata-tsrelay" |
134 |
134 |
|
135 ### Scaling |
|
136 |
|
137 Though performant by default, if you're going to be storing a LOT of |
|
138 data (or have a lot of netdata clients), here are some suggestions for |
|
139 getting the most bang for your buck: |
|
140 |
|
141 * Use the [pgbouncer](https://pgbouncer.github.io/) connection |
|
142 pooler. |
|
143 * DNS round robin the hostname where **netdata_tsrelay** lives across |
|
144 *N* hosts -- you can horizontally scale without any gotchas. |
|
145 * Edit your **netdata.conf** file to only send the metrics you are |
|
146 interested in. |
|
147 * Decrease the frequency at which netdata sends its data. (When in |
|
148 "average" mode, it averages over that time automatically.) |
|
149 * Use [Timescale](http://timescale.com) hypertables. |
|
150 * Add database indexes specific to how you intend to consume the data. |
|
151 * Use the PostgreSQL |
|
152 [JSON Operators](https://www.postgresql.org/docs/current/static/functions-json.html#FUNCTIONS-JSONB-OP-TABLE), |
|
153 which take advantage of GIN indexing. |
|
154 * Put convenience SQL VIEWs around the data you're fetching later, for |
|
155 easier graph building with [Grafana](https://grafana.com/) (or whatever.) |
|
156 |