Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
litespeed_wiki:config:real-time-stats [2019/01/04 16:12] Lucas Rolff Add information about the status page credentials |
litespeed_wiki:config:real-time-stats [2020/12/08 20:42] Lisa Clarke Extensive copyediting, fixes to inaccuracies |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Real-Time Statistics Monitoring Tool ==== | + | ====== Real-Time Statistics Monitoring Tool ====== |
- | There is a real-time stats link under WebAdmin Console -> Actions -> Real-Time Stats. | + | {{:litespeed_wiki:config:lsws-realtime-stats.png?800|}} |
- | {{:litespeed_wiki:config:ls-realtimestats.jpg?800|}} | + | You can view LiteSpeed Web Server statistics in realtime. Navigate to **WebAdmin Console > Actions > Real-Time Stats**. |
+ | The Real-Time Stats report is a convenient tool for monitoring the system, as it shows a snapshot of your server statistics. The report contains the following sections: | ||
- | The Real-Time Statistics link leads to a page with a real-time server status report. This is a convenient tool to monitor the system. The report shows a snapshot of your server statistics. The refresh rate for this snapshot is controlled by the Refresh Interval drop-down list in the upper righthand corner. The report contains the following sections: | + | * **Server Health** displays basic server statistics, uptime, load, and anti-DDoS blocked IPs. |
+ | * **Server** lists current traffic throughput, connections, and request statistics. | ||
+ | * **Virtual Host** shows request processing statuses and external application statuses for each virtual host. | ||
+ | * **External Application** lists the external applications currently running and their usage statistics. The CGI daemon process ''lscgid'' is always running as an external application. | ||
- | * Server Health shows the basic server statistics, uptime, load, and anti-DDoS blocked IPs. | + | {{:litespeed_wiki:config:lsws-realtime-stats-interval.png|}} |
- | * Server lists current traffic throughput, connections, and requests statistics. | + | |
- | * Virtual Host shows request processing statuses and external application statuses for each virtual host. | + | |
- | * External Application lists the external applications currently running and their usage statistics. The CGI daemon process lscgid is always running as an external application. | + | |
- | Many of the rows in the Real-Time Statistics feature a graph icon. Clicking on this icon will open a graph of that row's statistics updated in real-time. In the Server section, next to Requests, there is a link labeled (Details). This link takes you to the Requests Snapshot, where you can view detailed information on which clients are making certain kinds of requests or which aspects of your site are bottlenecking. The fields in the blue area allow you to filter the snapshot to isolate certain parts of your server or look for clients that are performing certain actions. | + | You can control the refresh rate for this data through the **Refresh Interval** drop-down list in the upper right corner. You can refresh anywhere from every five minutes to every ten seconds, or select ''Stop'' to avoid refreshing at all. |
- | The statistics are based on /tmp/lshttpd/.status and .rtreport*. Those files are usually updated every 10 seconds. Make sure "lsadm" user belongs to "lshttpd" folder group and .status and .rtreport file group so that it can read the reports to generate real-time stats in WedAdmin Console. | + | {{:litespeed_wiki:config:lsws-realtime-stats-details.png|}} |
- | You can also pull real-time statistics data from command line through .rtreport* files or through the local admin port: | + | Under **Server > Requests**, you will find a ''Details'' link. Click it to access the **Requests Snapshot**, where you can view detailed information on client requests or potential bottlenecks. The fields in the blue area allow you to filter the snapshot to isolate certain parts of your server or look for clients that are performing certain actions. |
- | Through .rtreport* files: | + | ===== Where the Data Comes From ===== |
- | cd /tmp/lshttpd/ | + | |
- | cat .rtreport<xx> (there could be multi .rereport and you should check the latest one, the name could be .rtreport<xx>) | + | |
- | Or Through the local admin port: | + | The real-time statistics are collected from ''.status'' and ''.rtreport'', located in ''/tmp/lshttpd/''. |
- | curl -i -u username:password http://localhost:7080/status?rpt=detail | + | |
- | curl -i -u username:password http://localhost:7080/status?rpt=summary | + | |
- | + | ||
- | username:password is the one for WebAdmin. | + | |
- | + | ||
- | When you install LiteSpeed Web Server the credentials for the ''/status'' page will be the ones you use to access the WebAdmin, however if you later decide to change the WebAdmin credentials, the credentials for the ''/status'' page will not be updated. | + | |
- | To do this, you can use the ''htpasswd'' tool to add users or update existing ones. | + | The ''.status'' file is updated at startup, or when something changes. |
- | htpasswd /usr/local/lsws/admin/htpasswds/status webadmin | + | The ''.rtreport'' files are generated per worker, and updated every 10 seconds. In a system with four workers, for example, you would have the following: |
- | The above example will add or update the user ''webadmin'', when executing the command, you'll get a password prompt to specify your password. | + | * ''.rtreport'' |
+ | * ''.rtreport.2'' | ||
+ | * ''.rtreport.3'' | ||
+ | * ''.rtreport.4'' | ||
- | If you're using CloudLinux, be aware that you should not change or remove the user called ''lve-stats-admin'' | + | **NOTE**: Be sure the ''lsadm'' user belongs to the same group as the ''lshttpd'' directory and the ''.status'' and ''.rtreport'' files, otherwise, ''lsadm'' will be unable to populate the **Real-Time Stats** screen. |
- | Since 5.2 we started forcing SSL so unless you forced disable SSL for admin menu you will want to force it at HTTPS and end in -k if it is a self-signed certificate. If you still run http instead of https, you may experience 403 error. | + | **NOTE**: For backwards compatibility, LSWS actually writes to ''/dev/shm'' for the ''.rtreport'' files. So, ''/tmp/lshttpd/.rtreport'' is a symbolic link to ''/dev/shm/lsws/status/.rtreport'', ''/tmp/lshttpd/.rtreport.2'' is a symbolic link to ''/dev/shm/lsws/status/.rtreport.2'', and so on. |
+ | |||
+ | ===== Accessing the Data Directly ===== | ||
+ | You can avoid using the WebAdmin Console and pull real-time statistics from the command line through the ''.rtreport'' files, or through the local admin port. | ||
+ | |||
+ | ==== Through .rtreport Files ==== | ||
+ | |||
+ | cd /tmp/lshttpd/ | ||
+ | cat .rtreport | ||
+ | |||
+ | Remember, there will be additional ''.rtreport'' files if you have multiple workers. You may ''cat'' any one of them. | ||
+ | |||
+ | **NOTE**: There is no auto-cleanup of ''.rtreport'' files, so if you have downgraded from four workers to two (for example) the old ''.rtreport.3'' and ''.rtreport.4'' files will remain. You can tell they are no longer used, if you look at the timestamp. | ||
+ | |||
+ | ==== Through the Local Admin Port ==== | ||
curl -i -k -u username:password https://localhost:7080/status?rpt=detail | curl -i -k -u username:password https://localhost:7080/status?rpt=detail | ||
+ | |||
curl -i -k -u username:password https://localhost:7080/status?rpt=summary | curl -i -k -u username:password https://localhost:7080/status?rpt=summary | ||
- | | + | |
- | For ''/status'' query, only 127.0.0.1 (localhost) was allowed before. Starting from 5.2.3, a new feature has been added to allow query from trusted IP set through Apache httpd.conf at server level. The native server level access control trusted IP does not work. You have to use Apache style config like the following: | + | For ''username:password'', use the WebAdmin username and password that you created when you installed LiteSpeed Web Server. If you have changed your WebAdmin credentials since installation, the credentials for the ''/status'' page will //not// have been updated. You must either use the original credentials, or change the ''/status'' page password. |
+ | |||
+ | The ''-k'' parameter is used if you have a self-signed certificate. | ||
+ | |||
+ | **NOTE**: The status summary is essentially a concatenation of all of the ''.rtreport'' files. If you have multiple workers, then there will be multiple sections, which are not combined. If you wish to see a full picture, you will need to manually add up the values. | ||
+ | |||
+ | === Change Status Page Password === | ||
+ | |||
+ | Use the ''htpasswd'' tool to add users or update existing ones, like so: | ||
+ | |||
+ | htpasswd /usr/local/lsws/admin/htpasswds/status webadmin | ||
+ | |||
+ | The above example will add or update the user ''webadmin''. When executing the command, you'll be given a password prompt to specify your password. | ||
+ | |||
+ | **NOTE:** If you're using CloudLinux, please do not change or remove the user called ''lve-stats-admin'' | ||
+ | |||
+ | === Allow Access from Trusted IP === | ||
+ | If you wish to allow access to the ''/status'' page from IPs other than 127.0.0.1 (localhost), you may use the following Apache-style configuration, replacing ''x.x.x.x'' with the IP you wish to allow: | ||
<IfModule Litespeed> | <IfModule Litespeed> | ||
allow from x.x.x.xT | allow from x.x.x.xT | ||
</IfModule> | </IfModule> | ||
- | |||