LVE Statistics
Package lve-stats collects LVE usage statistics, and allows to query the data.
To install, run:
# yum install lve-stats
If you are already running lve-stats (in case you are running cPanel LVE plugin), do:
# yum update lve-stats
This should also be updated automatically next time your system runs system wide update.
The package installs lvestats-server. You can re-start the server by running
# service lvestats restart
The package creates sqlite database /var/lve/lveinfo.db that holds historical information about LVE usage. Up to two months of hourly info is stored for each client. Higher resolution of data is stored for the past two days, and past 10 minutes.
Additionally it updates /var/lve/info every few seconds. That info is used by cPanel LVE plugin
Package consists of lveinfo utility to query LVE usage, and lvechart that allows you to chart usage for individual LVE.
To query historical LVE info, lveinfo command provided. It is located at /usr/sbin/lveinfo
Usage
# /usr/sbin/lveinfo [OPTIONS]
-h --help : this help screen
-v, --version : version number
-d, --display-username : try to convert LVE id into username when possible
-f, --from= : run report from date and time in YYYY-MM-DD HH:MM format
if not present last 10 minutes are assumed
-t, --to= : run report up to date and time in YYYY-MM-DD HH:MM format
if not present, reports results up to now
-o, --order-by= : orders results by one of the following:
cpu_avg : average CPU usage
cpu_max : max CPU usage
mep_avg : average number of entry processes (concurrent connections)
mep_max : max number of entry processes (concurrent connections)
total_mem_faults : total number of out of memory faults
total_mep_faults : total number of max entry processes faults
--id= : LVE id -- will display record only for that LVE id
-u, --user= : Use username instead of LVE id, and show only record for that user
-l, --limit= : max number of results to display, 10 by default
-c, --csv : display output in CSV format
-b, --by-usage : show LVEs with usage (averaged or max) within 90% percent of the limit
available values:
cpu_avg : average CPU usage
cpu_max : max CPU usage
mep_avg : average number of entry processes (concurrent connections)
mep_max : max number of entry processes (concurrent connections)
-p, --percentage : defines percentage for --by-usage option
-f, --by-fault : show LVEs which failed on max entry processes limit or memory limit
available values: mem, mep
-r, --threshold : in combination with --by-fault, shows only LVEs with number of faults above threshold specified
Output
ID : LVE Id or username aCPU : Average CPU usage mCPU : Max CPU usage lCPU : CPU Limit aEP : Average Entry Processes mEP : Max Entry Processes lEP : maxEntryProc limit MemF : Out Of Memory Faults MepF : Max Entry processes faults
Examples
Display top 10 users, by max CPU usage, from Oct 10, 2010 to Oct 15, 2010. Display username if possible
# lveinfo --from='2010-10-10' --to='2010-10-15' -o cpu_max --display-username ID aCPU mMax lCPU aEP mEP lEP MemF MepF 777 7 9 10 0 0 25 0 0 300 2 8 10 0 1 25 0 0 web2 1 6 10 0 0 25 0 0 web1 0 0 10 0 0 25 0 0
Display LVE info about user web2, from Oct 10, 2010 to Oct 15, 2010.
# lveinfo --from='2010-10-10' --to='2010-10-15' --user=web2 --display-username ID aCPU mMax lCPU aEP mEP lEP MemF MepF web2 1 6 10 0 0 25 0 0
