Difference between revisions of "Details about database connection"

From NetXMS Wiki
Jump to navigation Jump to search
m (Grammar)
m (Text replacement - "^" to "{{deprecated}}")
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{deprecated}}==Note==
In 2.0, connections 1, 4 and 5 were moved to the connection pool (6).
All DB connection pool server config variables were also renamed to contain the "DB" prefix.<br>
Example: "ConnectionPoolBaseSize" -> "DBConnectionPoolBaseSize", etc.
==General info==
==General info==
NetXMS creates the following database connections:
NetXMS creates the following database connections:
Line 6: Line 11:
! ID !! Name !! Description
! ID !! Name !! Description
|-
|-
| 1 || General purpose background writer || A single persistent dedicated connection
| 1 || Bootstrap / general purpose connection || A single persistent dedicated connection<br>
Used as an initial connection to retrieve other settings from DB. Also used minimally during server run-time.
|-
|-
| 2 || idata writer || A single persistent dedicated connection<br>
| 2 || idata writer || A single persistent dedicated connection<br>
Line 39: Line 45:
| 3 || Server.DBWriter.Requests.RawData
| 3 || Server.DBWriter.Requests.RawData
|-
|-
| 1, 4, 5, 6 || Server.DBWriter.Requests.Other
| 5 || Server.DBWriter.Requests.Other
|}
|}
You can then use DCI delta calculation to get the number of per second or per minute queue insertions.
You can then use DCI delta calculation to get the number of per second or per minute queue insertions.
Line 52: Line 58:
| 3 || Server.AverageDBWriterQueueSize.RawData
| 3 || Server.AverageDBWriterQueueSize.RawData
|-
|-
| 1, 4, 5, 6 || Server.AverageDBWriterQueueSize.Other
| 5 || Server.AverageDBWriterQueueSize.Other
|}
|}

Latest revision as of 18:13, 13 September 2022

This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide)

==Note==

In 2.0, connections 1, 4 and 5 were moved to the connection pool (6).

All DB connection pool server config variables were also renamed to contain the "DB" prefix.
Example: "ConnectionPoolBaseSize" -> "DBConnectionPoolBaseSize", etc.

General info

NetXMS creates the following database connections:

ID Name Description
1 Bootstrap / general purpose connection A single persistent dedicated connection

Used as an initial connection to retrieve other settings from DB. Also used minimally during server run-time.

2 idata writer A single persistent dedicated connection

Used to write collected data for each DCI

3 raw_dci_values writer A single persistent dedicated connection

Used to write raw last collected value for each DCI

4 Syncer thread writer A single persistent dedicated connection

Used by the syncer thread to write object changes to the DB

5 Database writers Used for delayed writes other than DCI data

Persistent connections - number controlled by "NumberOfDatabaseWriters" server config variable

6 DB connection pool Everything else

Connection pool controlled by "ConnectionPoolBaseSize" and "ConnectionPoolMaxSize" server config variables

All data that needs to be written to a database is first put into an in-memory queue.
Database writers then pick up records from the queue and write them into the database.

Monitoring database connections

You can monitor the amount of records inserted into each queue and also the size of each queue.

Database writer counters - these count the total database writer queue insertions.

ID Internal DCI name
2 Server.DBWriter.Requests.IData
3 Server.DBWriter.Requests.RawData
5 Server.DBWriter.Requests.Other

You can then use DCI delta calculation to get the number of per second or per minute queue insertions.

Database writer queue size - these give you average queue size for the last minute.

ID Internal DCI name
2 Server.AverageDBWriterQueueSize.IData
3 Server.AverageDBWriterQueueSize.RawData
5 Server.AverageDBWriterQueueSize.Other