Viewing HTTP requests with DTrace Apache Top

I worked with my friend Clay last night to add POSIX signal handlers and additional fields to the DTrace apachetop Perl script:

$ apachetop.pl

21:12:39    Requests:    347 (  69/sec)    Bytes:  35349b (7069b/sec,  101b/request)
Requests:   GETs:  347    POSTs:    0    HEADs:    0    TRACEs:    0
Responses:   1XX:    0      2XX:  301      3XX:   46       4XX:    0      5XX:    0

Requests   Requests/Sec   Bytes Sent    URI                                     
      13            2.6        13312    /blah                                   
       6            1.2            0    /manual/ja/mod/directives.html          
       6            1.2            0    /manual/ru/mod/directives.html          
       6            1.2            0    /manual/de/mod/directives.html          
       6            1.2            0    /manual/en/mod/directives.html          
       6            1.2            0    /manual/es/mod/directives.html          
       6            1.2            0    /manual/ko/mod/directives.html          
       2            0.4            0    /manual/ja/mod/                         
       2            0.4            0    /manual/es/mod/                         
       2            0.4            0    /manual/de/mod/                         
       2            0.4            0    /manual/ko/mod/                         
       2            0.4            0    /manual/en/mod/                         
       1            0.2            0    /manual/ja/mod/mod_negotiation.html     
       1            0.2            0    /manual/ja/mod/mod_isapi.html           
       1            0.2            0    /manual/ko/mod/mod_file_cache.html      
       1            0.2          344    /manual/ko/ru/mod/directives.html       
       1            0.2            0    /manual/ja/mod/mod_asis.html            
       1            0.2            0    /manual/es/mod/mod_autoindex.html       
       1            0.2            0    /manual/ru/mod/beos.html                
       1            0.2            0    /manual/ko/mod/mod_setenvif.html    

This version more closely resembles the awesome apachetop C program, but uses mod_dtrace instead of FAM and the Apache access_log to retrieve request data. Hope folks find this useful!

1 thought on “Viewing HTTP requests with DTrace Apache Top”

Leave a Reply

Your email address will not be published. Required fields are marked *