bsrmon
Overview
bsrmon is a performance monitoring tool that tracks the entire replication process of a BSR engine performing replication and records the time taken by each section of the engine's logic in real time to identify bottlenecks in the engine's behavior. The BSR kernel engine maintains performance-related statistics in the form of file logs, including a section-by-section time history of when the engine was running through internal time (jiffies) records and cumulative calculations. Administrators can monitor these statistical information of the kernel engine by querying with the bsrmon utility. bsrmon is supported from version 1.6.1.
In a linux environment, the Performance Monitor feature is only available in kernels with the debugfs feature enabled, and debugfs must be mounted in the /sys/kernel/debug path.
You can check if the debugfs feature is enabled using the following command.
# grep CONFIG_DEBUG_FS /boot/config-`uname -r` CONFIG_DEBUG_FS=y
Since debugfs is automatically mounted starting with CentOS7, and not automatically mounted in CentOS6, you can use the performance monitor feature after mounting it in the /sys/kernel/debug path. If you want to use the performance monitor feature even after a system reboot, you need to register that mount path in fstab.
# mkdir /sys/kernel/debug # mount -t debugfs debugfs /sys/kernel/debug
Types
The target types of the performance measurement. Corresponds to the types argument of bsrmon.
iostat, ioclat, reqstat, peer_reqstat, alstat, network, sendbuf, memstat
iostat {resource} {vnr}
Aggregate data for read and write I/O on the replica volume (io count, kbs, kb)
ioclat {resource} {vnr}
local/master I/O 의 complete latency (usec)
reqstat {resource} {vnr}
Aggregate data on the time taken to reach a specific segment based on when the request was created (usec)
requests : Number of requests processed during the monitoring period (cycles)
before_queue : Time spent before submitting work queued up
before_al_begin : Time spent before getting LRU of ACT_LOG
in_actlog : Time spent before RQ_IN_ACT_LOG was set.
submit : Time taken for request submit to be executed
bio_endio: Time taken for bio end logic to be executed
pre_send: Time spent before sending data to peer
acked: Time spent before RQ_NET_PENDING was removed after sending.
net_done: Time spent until RQ_NET_DONE
destroy : Time taken until request is released
Time for each leg of the AL UPTATE to complete (usec)
al_update : Number of active logs updated during the monitoring period (cycle)
before_bm_write : Before bsr_bm_write_hinted() execution
after_bm_write : After execution of bsr_bm_write_hinted()
after_sync_page : after execution of bsr_md_sync_page_io()
peer_reqstat {resource} {vnr}
Aggregate data on the time taken to reach a certain interval based on when the peer request was created (USEC)
peer_requests : Number of peer requests processed during the monitoring period (cycle)
submit : Time taken for a peer request submit to be executed
bio_endio: Time taken for the bio completion logic of a peer request to be executed.
destroy: Time taken for peer request to be destroyed
alstat {resource} {vnr}
Aggregate data for usage figures in active log
Aggregate used values, maximum value of used values
Aggregate incremental values of HITS, MISSES, STARVING, LOCKED, CHANGED
Count of AL_WAIT RETRY
Aggregation of AL shortage causes
starving, pending, used, busy, wouldblock
network {resource}
Replication network sending and receiving speed (byte/s)
sendbuf {resource}
Transmit buffer usage (bytes)
memstat
Memory usage by users and modules
In user space, the memory used by the bsradm, bsrsetup, bsrcon, bsrmon, and bsrservice processes is counted.
windows
Memory information obtained through GetProcessMemoryInfo()
WorkingSetSize, QuotaPagedPoolUsage, QuotaNonPagedPoolUsage, PagefileUsage
linux
Memory information obtained through the ps command
RSZ: Physical memory usage
vsz : Virtual memory usage
The following information about the memory used by the kernel module is aggregated by OS.
windows
Nonpaged, paged memory usage allocated by the driver with the 'BS--' tag
linux
slab cache information
/sys/kernel/slab/bsr_req
/sys/kernel/slab/bsr_al
/sys/kernel/slab/bsr_bm
/sys/kernel/slab/bsr_ee
resync_ratio {resource} {vnr}
Real-time replication, the amount of synchronization transfers and the ratio of synchronization transfers to it.
Updated only on the source node when synchronization is in progress.
Commands
/start
Enables the Performance Monitor feature and starts aggregating performance data and logging files. By default, Performance Monitor is enabled.
Enabling Performance Monitor is done through the following process
windows
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bsr\bsrmon_run registry value to 1
Enable the BSR Engine's performance data aggregation logic
Enable bsrmon /file execution logic in bsrservice
linux
Set the value of /etc/bsr.d/.bsrmon_run to 1
Enable BSR Engine's performance data aggregation logic
Run the /lib/bsr/bsrmon-run script. Run the bsrmon /file command periodically
/stop
Disable the performance monitor. Disabling stops the engine's performance data aggregation and file logging.
Deactivation is performed as follows
windows
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bsr\bsrmon_run Set the registry value to 0
Disable the BSR Engine's performance data aggregation logic
Disable the bsrmon /file run logic in bsrservice
linux
Set the value of /etc/bsr.d/.bsrmon_run to 0
Disable BSR Engine's performance data aggregation logic
Exit the /lib/bsr/bsrmon-run script
/status
Query the behavioral status of the performance monitor.
/file
Save performance data and memory information to a file. This is a hidden command and is used by the bsrservice and bsrmon-run scripts.
The file is stored in the following location
windows : C:\Program Files\bsr\log\perfmon
linux : /var/log/bsr/perfmon/
Only the lookup time and the numbers for each item are stored, and the data is parsed and formatted for output when you run the /show, /watch, or /report command.
/show
[/t {types[,...]|all}] [/r {resource[,...]|all}] [/j|/json] [/c|/continue]
Outputs performance data for all entries for all resources at once. The output target is the last data written to the performance file.
[/t {types[,...]|all}] [/r {resource[,...]|all}]
Provides the option to specify specific performance items and resources for output. Enter performance item and resource names separated by ',' and without spaces.
[/j|/json]
Outputs data in JSON format.
[/c|/continue]
Outputs performance data periodically. The output period follows the period value set in bsrmon.
Usage examples
Output everything on all resources
Output specific items from all resources
Output specific items from specific resources
/watch
{types} [/scroll]
Displays the data being aggregated by type in real-time. When using the /scroll option, the output is displayed in a line-by-line fashion.
/report
{types} [/f {filename}] [/p {peer_name[,...]}] [/d {YYYY-MM-DD}] [/s {timestamp}] [/e {timestamp}]
Output statistics of data written to files (including data from backed up files) by type.
[/f {filename}]
Enter the name of the file to report on. This is used to calculate statistics for a specific file.
[/p {peer_name[,...]}]
Enter the name of the peer to report on. This is used to calculate statistics for a specific peer. Separate multiple PEER entries with commas (,) without spaces. If not entered, output statistics to the PEERs of the resource configured on the server.
[/d {YYYY-MM-DD}] [/s {YYYY-MM-DD|hh:mm[:ss]|YYYY-MM-DD_hh:mm[:ss]}] [/e {YYYY-MM-DD|hh:mm[:ss]|YYYY-MM-DD_hh:mm[:ss]}]
This option allows you to query figures for a specific period. The /d option outputs statistics of data recorded on that date. /s specifies the start date and time of the query. /e specifies the end date and time of the query. When entering the /s, /e options, the date and time are separated by an underscore (_).
/set
{period, file_size, file_cnt} {value}
Commands to adjust numbers related to monitoring.
period
Sets the file saving and monitoring interval. Set in seconds, the default value is 1 second.
file_size
Set the file rolling size. Set in MB, the default value is 50 MB.
file_cnt
Set the number of file rolls. The default value is 3.
/get
{all, period, file_size, file_cnt}
Commands to get numbers related to monitoring.
/io_delay_test
{flag} {delay point} {delay time}
Intentionally cause I/O performance degradation to validate the functionality of the bsr performance monitor. This is a developer feature.
/debug cmds options
Commands for windows to retrieve debugfs information.