Logging server statistics with binary logging
The binary logging feature allows server information to be stored in binary files. These files can then be processed to analyze the server information that has been gathered over time.
About this task
- cluster address
- port number
- serverID
- server address
- server weight
- server total connections
- server active connections
- server port load
- server system load
Some of this information is retrieved from the executor as part of the manager cycle. Therefore the manager must be running in order for the information to be logged to the binary logs.
dslogreport 2001/05/01 8:00 2001/05/01 17:00
Procedure
- Start binary logging:
The start option starts logging server information to binary logs in the logs directory. One log is created at the start of every hour with the date and time as the name of the file.dscontrol binlog start
- Stop binary logging:
The stop option stops logging server information to the binary logs. The log service is stopped by default.dscontrol binlog stop
- Set the interval value to control how often information is
written to the logs.
dscontrol binlog set interval seconds
The manager will send server information to the log server every manager interval. The information is written to the logs only if the specified log interval seconds have elapsed since the last record was written to the log. By default, the log interval is set to 60 seconds. There is some interaction between the settings of the manger interval and the log interval. Since the log server is provided with information no faster than manager interval seconds setting the log interval less than the manager interval effectively sets it to the same as the manager interval.
This logging technique allows you to capture server information at any granularity. You can capture all changes to server information that are seen by the manager for calculating server weights. However, this amount of information is probably not required to analyze server usage and trends. Logging server information every 60 seconds gives you snapshots of server information over time. Setting the log interval very low can generate huge amounts of data.
- Set the retention option to control how long log files are
kept.
Log files older than the retention hours specified are deleted by the log server. This will only occur if the log server is being called by the manager, so stopping the manager will cause old log files not to be deleted.dscontrol binlog set retention hours
- View the current status for binary logging:
The status option returns the current settings of the log service. These settings are whether the service is started, what the interval is, and what the retention hours are.dscontrol binlog status