Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -e
- cd ~/live
- sidekiq_pid=`ps aux | grep sidekiq | grep -v grep | awk '{print $2}'`
- puma_pid=`ps aux | grep puma | grep -v grep | awk '{print $2}'`
- /home/mastodon/.rbenv/shims/bundle exec rbtrace -p $puma_pid --timeout 30 -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/puma.dump", "w"); ObjectSpace.dump_all(output: io); io.close}'
- /home/mastodon/.rbenv/shims/bundle exec rbtrace -p $sidekiq_pid --timeout 30 -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/sidekiq.dump", "w"); ObjectSpace.dump_all(output: io); io.close}'
- # ちょっと待つと吉
- sleep 5
- rm /tmp/dump.tar.gz
- tar -zcf /tmp/dump.tar.gz /tmp/puma.dump /tmp/sidekiq.dump
- rm /tmp/*.dump
Add Comment
Please, Sign In to add comment