PHP applications/environments monitoring: APM & Pinba Davide Mendolia - Patrick Allaert PHPBenelux Conference 2010
Davide Mendolia http://davidemendolia.blogspot.com/
dmendolia@php.net or @davideme (Twitter)
Lead developer of APM
php-benchmark contributor
http://www.php-ci.net/
Works at Tuenti
Social network , based in Madrid
More than 20 billion page views per month
First Spanish website ahead Google, Microsoft and Facebook (Comscore)
International work environment (15 nationalities)
Developers wanted!
Patrick Allaert http://patrickallaert.blogspot.com/
patrickallaert@php.net or @patrick_allaert (Twitter)
Lead developer of APM
Works at eZ Systems (eZ Publish, eZ Components)
PHPBenelux staff member ( http://www.phpbenelux.eu/ )
Patrick Allaert Start programming with PHP 3
Ten years of Free Software evangelism
Contributions: PHP (ext/ldap, QA: PHPT)
KDESvn (Subversion client for KDE)
XOo°f (eXtensible Open Object Oriented Framework)
Tabellio (collaborative suite for parliamentary assembly)
Monitoring: Definition ? Being aware of the state of a system by watching and measuring it.
Indicators: the physical condition of a machine
load of a machine
application availability
the messages in system logs
network performance
known attacks
Monitoring: Why? Need in terms of increasing availability
Economic reasons
User experience
Monitoring: Why? « When I get on the homepage I have a blank page […] » « Seriously? One moment, checking […] » « We are aware of the problem, our engineers have found the solution. Everything will be back to normal in 5 minutes » « Hell! You're right!? »
Monitoring: Presentation Monitoring the P of LAMP. In particular: Error handling in PHP
Execution performance.
What are the solutions ? Current: PHP
Zend Platform Newcomers: APM (Alternative PHP Monitor)
Pinba
PHP: integrated functions error_reporting
display_errors
error_log file
syslog Windows => event log set_error_handler()

PHP applications/environments monitoring: APM & Pinba

Editor's Notes

  • #7 Surveiller d'eventuellle erreur comportementale de l'application. Surveiller au niveau des performances, afin de prevoir d'eventuel probleme
  • #12 Page de demo avec E_NOTICE et autre, Display avec tail
  • #15 Tail -f /var/log/php/error.log Page vide de apm.php Puis generation d'une page d'erreur Affichage de apm.php Recommecer avec mutilple erreur
  • #16 Rappel, qu'est ce que APC, Xdebug, … Compatbilité totale avec le monde du LL
  • #24 Compatbilité totale avec le monde du LL
  • #25 L'extension PHP Pinba envoie un paquet UDP lors de la terminaison d'une requête qui contient des informations comme: hostname - gethostname() result request_count - number of requests served by this process server_name script_name document_size - size of the response body memory_peak - memory allocation peak request_time - time spent of processing the request ru_utime - resource usage (user) ru_stime - resource usage (system) timers - array of timers (optional) De la nature UDP, aucune connexion n'est réalisée, ce qui permet d'avoir aucun impacte de performance, mais des pertes de paquets pourraient se produire. De l'autre coté, le plugin MySQL Pinba écoute sur le port configuré pour récupérer les paquets et les décoder afin de les stocker dans ses pools d'enregistrements ainsi que de mettre à jour les index, les rapports de bases et rapports de tags si ils existent.
  • #32 Raw data tables contain raw request data (surprise!). Please bear in mind that access to the raw data is relatively slow (the number of records might reach millions and there are NO indexes except for primary keys, so almost any operation requires full table scan). Reports were created in order to speed up the most frequent operations by aggregating data on-the-fly, when new request data arrives.