Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Spying on Apache and PHP with Strace

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,301
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 15, 2011

This video shows how to use strace to determine why an apache worker loads a page slowly. Commands shown in this video:

telnet localhost 80
lsof -p `pidof telnet`
netstat -nap | grep pid
strace -o /tmp/output -f -s4096 -r -p pid
cat /tmp/output | cut -c12-16 | sort -rn | head

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (elspuddo)

  • at 13:47 how did you suddenly get from that php code to the read/write result? How would you know which result too look for once you found the php line?

  • @brusdaar This is a big 4k string of text, and the beginning of the line didn't show up on the screen at 13:47. A little later at 14:00 I move up a bit and you can see the beginning of that line (one line down from the cursor) which begins with "read(11,\1...." . At 14:00 can you see the read, but not the smoking gun (the embedded PHP sleep) although it is there. The PHP code came from a mysql write/read (query/response) action, but it wasn't clear because you couldn't see the whole line.

  • Did you bump up the Apache timeouts? IIRC you dont typically get that long to look for it.

  • @iamfaze I didn't mess with the apache timeouts, I think they were default for CentOS. You're right though, it seems the timeouts are often much tighter than that.

see all

All Comments (14)

Sign In or Sign Up now to post a comment!
  • Great and informative video, many thanks for your effort!

  • Simply awesome video!

    I wonder if its possible to use STRACE to see if a process is trying to delete files/folders...

  • What flavor is that? Looks like an awesome setup.

  • very thorough and "extreme" web debugging. Might come in handy one day.

  • video is very informative. please turn your volume up though :)

  • I'll have to apply this to Apache and Perl now. Good job on the video and thanks.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more