@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 99 lines 4.1 kB view raw
1@title Multimeter User Guide 2@group userguide 3 4Using Multimeter, a sampling profiler. 5 6Overview 7======== 8 9IMPORTANT: This document describes a prototype application. 10 11Multimeter is a sampling profiler that can give you coarse information about 12Phorge resource usage. In particular, it can help quickly identify sources 13of load, like bots or scripts which are making a very large number of requests. 14 15Configuring and Using Multimeter 16================================ 17 18To access Multimeter, go to {nav Applications > Multimeter}. 19 20By default, Multimeter samples 0.1% of pages. This should be a reasonable rate 21for most installs, but you can increase or decrease the rate by adjusting 22`debug.sample-rate`. Increasing the rate (by setting the value to a lower 23number, like 100, to sample 1% of pages) will increase the granularity of the 24data, at a small performance cost. 25 26Using Multimeter 27================ 28 29Multimeter shows you what Phorge has spent time doing recently. By 30looking at the samples it collects, you can identify major sources of load 31or resource use, whether they are specific users, pages, subprocesses, or 32other types of activity. 33 34By identifying and understanding unexpected load, you can adjust usage patterns 35or configuration to make better use of resources (for example, rewrite bots 36that are making too many calls), or report specific, actionable issues to the 37upstream for resolution. 38 39The main screen of Multimeter shows you everything Phorge has spent 40resources on recently, broken down by action type. Categories are folded up 41by default, with "(All)" labels. 42 43To filter by a dimension, click the link for it. For example, from the main 44page, you can click "Web Request" to filter by only web requests. To expand a 45grouped dimension, click the "(All)" link. 46 47For example, suppose we suspect that someone is running a bot that is making 48a lot of requests and consuming a lot of resources. We can get a better idea 49about this by filtering the results like this: 50 51 - Click {nav Web Request}. This will show only web requests. 52 - Click {nav (All)} under "Viewer". This will expand events by viewer. 53 54Recent resource costs for web requests are now shown, grouped and sorted by 55user. The usernames in the "Viewer" column show who is using resources, in 56order from greatest use to least use (only administrators can see usernames). 57 58The "Avg" column shows the average cost per event, while the "Cost" column 59shows the total cost. 60 61If the top few users account for similar costs and are normal, active users, 62there may be nothing amiss and your problem might lie elsewhere. If a user like 63`slowbot` is in the top few users and has way higher usage than anyone else, 64there might be a script running under that account consuming a disproportionate 65amount of resources. 66 67Assuming you find a user with unusual usage, you could dig into their usage 68like this: 69 70 - Click their name (like {nav slowbot}) to filter to just their requests. 71 - Click {nav (All)} under "Label". This expands by request detail. 72 73This will show exactly what they spent those resources doing, and can help 74identify if they're making a lot of API calls or scraping the site or whatever 75else. 76 77This is just an example of a specific kind of problem that Multimeter could 78help resolve. In general, exploring Multimeter data by filtering and expanding 79resource uses can help you understand how resources are used and identify 80unexpected uses of resources. For example: 81 82 - Identify a problem with load balancing by filtering on {nav Web Request} 83 and expanding on {nav Host}. If hosts aren't roughly even, DNS or a load 84 balancer are misconfigured. 85 - Identify which pages cost the most by filtering on {nav Web Request} 86 and expanding on {nav Label}. 87 - Find outlier pages by filtering on {nav Web Request} and expanding on 88 {nav ID}. 89 - Find where subprocess are invoked from by filtering on {nav Subprocesses}, 90 then expanding on {nav Context}. 91 92 93Next Steps 94========== 95 96Continue by: 97 98 - understanding and reporting performance issues with 99 @{article:Troubleshooting Performance Problems}.