xtstat

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

xtstat serve a monitorare le attività interne di PBXT.

xtstat interroga la tabella INFORMATION_SCHEMA.PBXT_STATISTICS. L'intervallo tra le interrogazioni può essere impostato attraverso l'opzione --delay, il cui valore predefinito è 1 secondo.

Per la maggioranza delle statistiche, xtstat mostra la differenza tra il valore ricevuto con l'ultima interrogazione e il precedente. Per esempio, se i byte scritti sono 1000, e all'ultima interrogazione erano 800, allora xtstat mostra 200. Questo significa che nell'ultimo intervallo di tempo sono stati scritti su disco 200 byte.

Usare xtstat

xtstat si invoca come segue:

$ xtstat [ opzioni ]

Per esempio, per aggiornarlo ogni 10 secondi:

xtstat -D10

Si noti che i contatori delle statistiche non vengono mai azzerati, nemmeno se avviene un rollback. Per esempio, se un'istruzione UPDATE subisce un rollback, xtstat continuerà a indicare che un'istruzione UPDATE è stata eseguita (si veda stat-write, più sotto).

Se MariaDB si arresta o va in crash, xtstat cercherà di riconnettersi. xtstat può essere terminato con la combinazione di tasti CTRL-C.

Non tutte le statistiche sono disponibili, fino a quando PBXT non viene recuperato. In particolare, le statistiche relative ai thread in background di PBXT non sono disponibili (comprese sweep e chkpnt).

Command line options

xtstat options are as follows:

Option Description
-?, --helpPrints help text.
-h, --host=valueConnect to host.
-u, --user=valueUser for login if not current user.
-p, --password[=value]Password to use when connecting to server. If password is not given it's asked from the tty.
-d, --database=valueDatabase to be used (pbxt or information_schema required), default is information_schema
-P, --port=valuePort number to use for connection.
-S, --socket=valueSocket file to use for connection.
-D, --delay=valueDelay in seconds between polls of the database.
--protocol=valueConnection protocol to use: default/tcp/socket/pipe/memory
--display=valueColumns to display: use short names separated by | (the pipe character), partial match allowed. Use --display=all to display all columns available.

Connection options will also be taken from the MySQL config file if available.

Size indicators

Values displayed by xtstat are either a time in milliseconds, a value in bytes, or a counter. If these values are too large to be displayed then the value is rounded and a size indicator is added.

The following size indicators are used:

K:Kilobytes (1,024 bytes)
M:Megabytes (1,048,576 bytes)
G:Gigabytes (1,073,741,024 bytes)
T:Terabytes (1,099,511,627,776 bytes)
t:thousands (1,000s)
m:millions (1,000,000s)
b:billions (1,000,000,000s)

Statistics

The following is a list of the statistics displayed by xtstat. Each statistic as a two-part display name. The first part is the category and the second part is the type.

You can select categories and types for display, as you require. For example --display=read will display all read activity, --display=xact|stat will display transaction and statement activity.

Note, for diagnostics it is best to capture all statistics. The reason is because you never now where a problem might turn up, so without certain statistics you may not be able to identify the problem.

Display nameNameDescription
time-currCurrent TimeThe current time in seconds
time-msecTime Since Last CallTime passed in milliseconds since last statistics call
xact-commtCommit CountNumber of transactions committed
xact-rollbRollback CountNumber of transactions rolled back
xact-waitsWait for Xact CountNumber of times waited for another transaction
xact-dirtyDirty Xact CountNumber of transactions still to be cleaned up. This also includes all the currently running transactions. Cleanup means that the Sweeper thread must still scan the transcation and collect/mark any "garbage" left by the transaction. Garbage is, for example, versions of rows that are no longer visiable by any transaction.
stat-readRead StatementsNumber of SELECT statements
stat-writeWrite StatementsNumber of UPDATE/INSERT/DELETE statements
rec-inRecord Bytes ReadBytes read from the record/row files
rec-outRecord Bytes WrittenBytes written to the record/row files. This data is transfered from the transaction logs to the handle data (xtd) and the row index files (xtr).
rec-syncs/msRecord File Flushes2 values separated by a '/': the number of flushes to data handle (.xtd) and row index (.xtr) files and the time taken in milliseconds to perform the flush operations.
rec-hitsRecord Cache HitsHits when accessing the record cache. The record cache caches the data handle (.xtd) and row index (.xtr) files.
rec-missRecord Cache MissesMisses when accessing the record cache
rec-freesRecord Cache FreesNumber of record cache pages freed
rec-%useRecord Cache UsagePercentage of record cache in use. This value is displayed by xtstat as a percentage of the total cache available, but the value returned by PBXT_STATISTICS table is in bytes used.
ind-inIndex Bytes ReadBytes read from the index files
ind-outIndex Bytes WrittenBytes written to the index files. This data is transfered from the index log files (ilog) to the index files (xti), during a consistent flush of the index.
ind-syncs/msIndex File Flushes2 values separated by a '/': the number of flushes to index files and the time taken for the flush operations in milliseconds.
ind-hitsIndex Cache HitsHits when accessing the index cache
ind-missIndex Cache MissesMisses when accessing the index cache
ind-%useIndex Cache UsagePercentage of index cache used. This value is displayed by xtstat as a percentage of the total cache available, but the value returned by PBXT_STATISTICS table is in bytes used.
ilog-inIndex Log Bytes InBytes read from the index log files
ilog-outIndex Log Bytes OutBytes written to the index log files. This data is transfered from the index cache in main memory to the index log files (ilog) during a consistent flush of the index.
ilog-syncs/msIndex Log File Syncs2 values separated by a '/': the number of flushes to index log files and the time taken for the flush operations in milliseconds
xlog-inXact Log Bytes InBytes read from the transaction log files
xlog-outXact Log Bytes OutBytes written to the transaction log files. This is data transfered from the transaction log buffer (pbxt_transaction_buffer_size) to the transaction log files (.xlog). This transfer occurs on commit or when the transaction log buffer is full.
xlog-syncsXact Log File SyncsNumber of flushes to transaction log files
xlog-msecXact Log Sync TimeThe time in milliseconds to flush transaction log files
xlog-hitsXact Log Cache HitsHits when accessing the transaction log cache
xlog-missXact Log Cache MissesMisses when accessing the transaction log cache
xlog-%useXact Log Cache UsagePercentage of transaction log cache used. This value is displayed by xtstat as a percentage of the total cache available, but the value returned by PBXT_STATISTICS table is in bytes used.
data-inData Log Bytes InBytes read from the data log files
data-outData Log Bytes OutBytes written to the data log files. This data is transfered from the data log buffer (pbxt_log_buffer_size) to the data log files (.dlog), when the buffer is full, or on commit.
data-syncsData Log File SyncsNumber of flushes to data log files
data-msecData Log Sync TimeThe time in milliseconds spent flushing data log files
to-chkptBytes to CheckpointBytes written to the transaction log since the last checkpoint
to-writeLog Bytes to WriteBytes written to the transaction log, still to be written to the database
to-sweepLog Bytes to SweepBytes written to the transaction log, still to be read by the Sweeper thread
sweep-waitsSweeper Wait on Xact  Attempts to cleanup a transaction
scan-indexIndex Scan CountNumber of index scans
scan-tableTable Scan CountNumber of table scans
row-selSelect Row CountNumber of rows selected
row-insInsert Row CountNumber of rows inserted
row-updUpdate Row CountNumber of rows updated
row-delDelete Row CountNumber of rows deleted

More Information

Documentation on this page is based on the xtstat documentation on the PrimeBase website.

Paul McCullagh's presentation from the 2010 User's Conference has some usage examples: http://www.primebase.org/download/pbxt-uc-2010.pdf

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.