From collectd Wiki
Revision as of 01:58, 12 March 2020 by Efoley (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Pinba plugin
Type: read
Callbacks: config, init, read, shutdown
Status: supported
First version: 4.10
Copyright: 2007–2009 Antony Dovgal
2010 Phoenix Kayo
2010 Florian octo Forster
License: GPLv2
Manpage: collectd.conf(5)
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 "">
    Server ""
    Script "/search.php"
  # Per-webserver statistics
  <View "">
    Host "www-a"
    Server ""
    Script "/search.php"
  <View "">
    Host "www-b"
    Server ""
    Script "/search.php"

The above example assumes that you have website 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.

Example graph

None yet. Add one now!


See also