Présentation en anglais dans les locaux de LightSpeed à Montréal.
Titre: Multilevel Debugging of Web Applications
De: Naser Ezzat @naserjv, polytechnique de Montréal
51 slides, 54 minutes.
Début de la présentation à 19:18, fin 20:12, fatigue: 20:00
Mot clés: LAMP, LTTng, Trace, Compass, PHP, MySQL
Note
LTTng allows low-level/low-cost tracing for Linux kernel.
We can use log from LTTng in Trace Compass.
- Other tracers, like ftrace
LTTng allows high-level application tracing.
- instrumental
- LTTng-UST (user-trace) with tracepoint() function
A Apache2 Module is available for LTTng
- https://github.com/naser/Apache-LTTng-Module
A PHP Extension is available for LTTng
- https://github.com/naser/LTTng-enabled-PHP
- https://github.com/naser/php-LTTng-tracing-module
- 13 tracepoints: request, function, error, compile, event, exception
- add trace_print()
With MySQL/MariaDB
- 60 tracepoints
./configure --enable-lttng
cmake
make
make install
(Note: I don't see any --enable-lttng in https://github.com/MariaDB/server or in cmake/configure.pl)
or in https://github.com/mysql/mysql-server/search?q=lttng&unscoped_q=lttng
(Don't find anything on mysql and lttng, except about this presentation)
Integration full stack
Linux Kernel
- Apache2
- PHP
- MySQL
Views : timeline, flame chart
Performance
- almost the same with apache bench (5000 request), with lttng, max-lttng, min-lttng or without.
ab -c [5-100] -n 5000 http://www.website.com/
Use Case 1: PHP OP-Cache verification
Detect PHP Share Memory Lock (inter process in apache2)
Detec update/write memory cache slowdown
Allow Dual-Tracing
- with trigger (threshold) to enable kernel tracing for some millisecond after an event
- log always in cache but no output in file unless there is a trigger
Question
Q: Can we filter PHP tracing by namespace, path or module ?
A: Not with the lttng, but you can filter the log after.
Compléments
LTTng: Linux Trace Toolkit Next Generation
LTTng-UST: Linux Trace Toolkit Next Generation Userspace Tracer
- https://github.com/lttng/lttng-ust
- git://git.lttng.org/lttng-ust.git
Other tracers:
- ftrace, DTrace (unix/mac os x), ktrace, ltrace, strace, SystemTap
Mysql + LTTng, un peu les mêmes renseignements que EXPLAIN?