Difference between revisions of "Plugin:Pinba"
(→Synopsis: Explain the example config.)
|Line 63:||Line 63:|
Latest revision as of 01:58, 12 March 2020
|Callbacks:||config, init, read, shutdown|
|Copyright:|| 2007–2009 Antony Dovgal|
2010 Phoenix Kayo
2010 Florian octo Forster
|List of Plugins|
The Pinba plugin receives and dispatches timing values from Pinba, a profiling extension for PHP.
The Pinba extension is an extension for the PHP interpreter which collects runtime information about PHP scripts and sends a single UDP packet at the end of execution to a configured address. The Pinba plugin listens for such UDP packets, parses them and aggregates the statistics. Once per interval, the daemon queries those statistics and dispatches them to the write plugins.
Currently, the plugin provides the following information:
- Requests (executions) per second
- Average running time
- Amount printed (bytes per second)
- User and system resource usage
- Peak memory usage
Timing information in form of custom tags is currently not supported.
In order to get meaningful and interesting statistics, it is possible to group the statistics by the webserver's hostname (via gethostname(2)), the virtual server's name and the script's name. Grouping is done by views. It is possible to account for an UDP packet twice, for example in a per-host and a per-vhost statistic.
<Plugin pinba> Address "::0" Port "30002" # Per-vhost statistic <View "www.example.com-search"> Server "www.example.com" Script "/search.php" </View> # Per-webserver statistics <View "www-a.example.com-search"> Host "www-a" Server "www.example.com" Script "/search.php" </View> <View "www-b.example.com-search"> Host "www-b" Server "www.example.com" Script "/search.php" </View> </Plugin>
The above example assumes that you have website www.example.com which is served by two webservers, www-a and www-b using some form of load-balancing. The first view will gather statistics for the search script on both webservers, showing what the user experiences. The second and third view collect the same information, but only for one webserver each. This information may be interesting for an administrator, for example to judge whether load-balancing is working correctly.
None yet. Add one now!