Skip to content

Instantly share code, notes, and snippets.

@dmitryame
Created May 11, 2011 15:46

Revisions

  1. dmitryame revised this gist May 18, 2011. 1 changed file with 37 additions and 1 deletion.
    38 changes: 37 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -22,4 +22,40 @@ java -jar myapp.war --help


    #produce a heap dump on running tomcat
    jmap -dump:live,format=b,file=heap.bin <pid>
    jmap -dump:live,format=b,file=heap.bin <pid>




    #some notes from rails conf
    lsof -nPp <pid>

    tcpdump -i eth0 -s 0 -nqA

    tcpdump -w <file>
    then wireshark the file

    strace -cp <pid>
    strace -ttTp <pid> -o <file>

    ltrace -cp <pid>
    ltrace -c ruby threaded_em.rb
    ltrace -ttT -e memcpy ruby threaded_em.rb

    require 'rbtrace'
    rbtrace -p <pid> -m <method>
    rbtrace -p <pid> --slow=50
    rbtrace -p <pid> -c <predefined tracer>

    perftools from google feasible for production

    perftools.rb

    gdb
    gdb.rb

    gem install memprof
    memprof.com

    gem install hotspots

  2. dmitryame revised this gist May 13, 2011. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,8 @@ java -jar myapp.war --help

    # hotline nsieger@engineyard.com

    #jruby -S rails new myapp --template http://jruby.org
    #jruby -S rails new myapp --template http://jruby.org


    #produce a heap dump on running tomcat
    jmap -dump:live,format=b,file=heap.bin <pid>
  3. dmitryame created this gist May 11, 2011.
    21 changes: 21 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #jruby hacks

    jps -ml #show java processes running

    jstack <pid> #get a jvm stack info

    jruby -J-Djruby.reify.classes=true # a flag that tell jruby to compile ruby classes to real (matching) java classes

    jvisualvm #great profiling tool


    ab -n 1000 -c 10 http://localhost:3000 #apache bench command to load up a server

    jruby -S warble executable compile war # creating executable war
    java -jar myapp.war #run the executable war
    java -jar myapp.war --help


    # hotline nsieger@engineyard.com

    #jruby -S rails new myapp --template http://jruby.org