DEBUGGING PHP WITH
STRACE AND SYSDIG
JOSHUA EICHORN
CTO PAGELY
WHAT
• System level debugging tools
• See system calls
• See network/disk io
WHY
• IO is the most common cause of problems
• No overhead when not in use
• Much lower overhead then newrelic/etc
• Easy install
STRACE
• Easy install
• Apt-get install etc
• See system calls
• Lots of filters
• Output is raw
SYSDIG
• Needs a kernel module
• Easy install on anything new
• Protocol aware http etc
• Container aware
• Easy to see all the traffic on port 80 or 9000
DEBUGGING A CLI SCRIPT
• Trace script
• Watch a script with no status
• See mysql queries
DEBUGGING PHP-FPM
• Broken config, see fpm headers
• Log messages with broken logging
• Finding a slow http request
SYSDIG AND CHISELS
• Scripts to parse raw data
• Protocol decoding
• Summary
NETWORK DEBUGGING WITH SYSDIG
• Http traffic/http chisel
• PHP-fpm traffic
• Filter to just POST requests
• From a specific IP
• Using with SSL
SYSDIG AND CONTAINERS
• See network io in a container
• See disk io in a container
• Snoop on tty activity
SYDIG LINKS
• http://www.sysdig.org/wiki/sysdig-user-guide/
• http://www.sysdig.org/wiki/sysdig-examples/
WHEN TO USE EACH TOOL
• Strace
• When you don’t have root
• Finding general slowness
• Broken configs
• What is that script doing
• Sysdig
• Watching network traffic
• What is that container doing
• You want tcpdump
IS HIRING DEVOPS ENGINEERS
• Want to use Strace and Sysdig on the job
• Join Pagely’s Devops Team
• https://pagely.com/careers/devops-engineer-remote-jr-mid/

Debugging with Strace and Sysdig

  • 1.
    DEBUGGING PHP WITH STRACEAND SYSDIG JOSHUA EICHORN CTO PAGELY
  • 2.
    WHAT • System leveldebugging tools • See system calls • See network/disk io
  • 3.
    WHY • IO isthe most common cause of problems • No overhead when not in use • Much lower overhead then newrelic/etc • Easy install
  • 4.
    STRACE • Easy install •Apt-get install etc • See system calls • Lots of filters • Output is raw
  • 5.
    SYSDIG • Needs akernel module • Easy install on anything new • Protocol aware http etc • Container aware • Easy to see all the traffic on port 80 or 9000
  • 6.
    DEBUGGING A CLISCRIPT • Trace script • Watch a script with no status • See mysql queries
  • 7.
    DEBUGGING PHP-FPM • Brokenconfig, see fpm headers • Log messages with broken logging • Finding a slow http request
  • 8.
    SYSDIG AND CHISELS •Scripts to parse raw data • Protocol decoding • Summary
  • 9.
    NETWORK DEBUGGING WITHSYSDIG • Http traffic/http chisel • PHP-fpm traffic • Filter to just POST requests • From a specific IP • Using with SSL
  • 10.
    SYSDIG AND CONTAINERS •See network io in a container • See disk io in a container • Snoop on tty activity
  • 11.
    SYDIG LINKS • http://www.sysdig.org/wiki/sysdig-user-guide/ •http://www.sysdig.org/wiki/sysdig-examples/
  • 12.
    WHEN TO USEEACH TOOL • Strace • When you don’t have root • Finding general slowness • Broken configs • What is that script doing • Sysdig • Watching network traffic • What is that container doing • You want tcpdump
  • 13.
    IS HIRING DEVOPSENGINEERS • Want to use Strace and Sysdig on the job • Join Pagely’s Devops Team • https://pagely.com/careers/devops-engineer-remote-jr-mid/