A summary of data about the Ruby ecosystem.

https://github.com/fluent/sigdump

Use signal to show stacktrace of a Ruby process without restarting it
https://github.com/fluent/sigdump

Keywords from Contributors

cncf data-collector fluentd fluentd-plugin activejob activerecord mvc rack

Last synced: about 21 hours ago
JSON representation

Repository metadata

Use signal to show stacktrace of a Ruby process without restarting it

README.md

sigdump

In short: SIGQUIT of Java VM for Ruby.

Server applications (like Rails apps) cause performance problems, deadlock or memory swapping from time to time. But it's difficult to reproduce such kind of problems. sigdump makes it possible to get information from a running process without restarting. Just sending SIGCONT signal will dump backtrace and memory profile to /tmp/sigdump-<pid>.log file.

sigdump dumps following information (see also Sample output):

  • Backtrace of all threads
  • Number of allocated objects per class
  • GC profiler reports if GC profiler is enabled (GC::Profiler.enable is called)
  • Stacktrace of Java threads for each Ruby threads if the runtime is JRuby

Install

Just install sigdump gem and add require 'sigdump/setup' line to your code. Or you can use Bundler as following:

# Gemfile
gem 'sigdump', require: 'sigdump/setup'

Note for Resque:

You need to change the default signal (SIGCONT) because Rescue traps SIGCONT and it conflicts with sigdump.
To change the signal, set name of a signal to SIGDUMP_SIGNAL environment variable. For Rails, you can add following lines to environment.rb file:

# setup sigdump: https://github.com/frsyuki/sigdump
ENV['SIGDUMP_SIGNAL'] = 'TSTP'
require 'sigdump/setup'

Usage

Send SIGCONT signal to the Ruby process. It dumps backtrace and memory profile to /tmp/sigdump-<pid>.log file.

$ kill -CONT <pid>
$ cat /tmp/sigdump-<pid>.log

Set SIGDUMP_SIGNAL environment variable to change the signal (default: SIGCONT).

Set SIGDUMP_PATH environment variable to change the output path (default: /tmp/sigdump-<pid>.log). You can set "-" here to dump to STDOUT, or "+" to STDERR.

Sample outout

$ cat /tmp/sigdump-9218.log
Sigdump at 2013-04-24 16:57:12 +0000 process 9218 (unicorn worker[3] -E staging -c /etc/unicorn/staging.rb -E staging)
  Thread #<Thread:0x00000001424518> status=run priority=0
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/sigdump-0.1.0/lib/sigdump.rb:32:in `dump_backtrace'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/sigdump-0.1.0/lib/sigdump.rb:19:in `block in dump_all_thread_backtrace'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/sigdump-0.1.0/lib/sigdump.rb:18:in `each'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/sigdump-0.1.0/lib/sigdump.rb:18:in `dump_all_thread_backtrace'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/sigdump-0.1.0/lib/sigdump.rb:9:in `block (2 levels) in install_thread_dump_handler'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/sigdump-0.1.0/lib/sigdump.rb:91:in `open'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/sigdump-0.1.0/lib/sigdump.rb:91:in `_open_dump_path'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/sigdump-0.1.0/lib/sigdump.rb:7:in `block in install_thread_dump_handler'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:626:in `call'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:626:in `select'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:626:in `worker_loop'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:137:in `start'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/bin/unicorn:121:in `<top (required)>'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/bin/unicorn:23:in `load'
      /srv/staging/current/vendor/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>'
  GC stat:
      count: 34
      heap_allocated_pages: 1366
      heap_sorted_length: 1368
      heap_allocatable_pages: 0
      heap_available_slots: 556777
      heap_live_slots: 551708
      heap_free_slots: 5069
      heap_final_slots: 0
      heap_marked_slots: 363350
      heap_swept_slots: 58807
      heap_eden_pages: 1366
      heap_tomb_pages: 0
      total_allocated_pages: 1367
      total_freed_pages: 1
      total_allocated_objects: 2438499
      total_freed_objects: 1886791
      malloc_increase_bytes: 650416
      malloc_increase_bytes_limit: 16777216
      minor_gc_count: 25
      major_gc_count: 9
      remembered_wb_unprotected_objects: 5122
      remembered_wb_unprotected_objects_limit: 5222
      old_objects: 348964
  Built-in objects:
   367,492: TOTAL
   208,193: T_STRING
    61,817: T_ARRAY
    37,343: T_DATA
    28,293: T_NODE
    10,678: T_OBJECT
     6,385: T_HASH
     5,957: T_CLASS
     2,300: T_ICLASS
     2,184: T_REGEXP
     1,547: T_MODULE
       900: T_FLOAT
       677: T_STRUCT
       497: T_BIGNUM
       432: T_MATCH
       251: T_RATIONAL
        29: T_FILE
         8: FREE
         1: T_COMPLEX
  All objects:
   207,335: String
    32,987: Array
    28,665: RubyVM::InstructionSequence
     5,863: Hash
     3,759: RubyVM::Env
     3,680: Proc
     2,338: Class
     2,184: Regexp
     1,632: MIME::Type
     1,547: Module
     1,040: Gem::Version
       982: Gem::Requirement
       945: Float
       920: Journey::Nodes::Cat
       804: Time
       660: Gem::Dependency
       497: Bignum
  ...
  String 7,556,137 bytes
   Array 821 elements
    Hash 90 pairs

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 31
Total Committers: 7
Avg Commits per committer: 4.429
Development Distribution Score (DDS): 0.258

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
FURUHASHI Sadayuki f****i@u****p 23
sonots s****s@g****m 2
Kenta Murata m****n@c****m 2
yui-knk s****a@g****m 1
fatkodima f****3@g****m 1
Daijiro Fukuda f****a@c****m 1
yu74n y****n@u****) 1

Committer domains:


Issue and Pull Request metadata

Last synced: 5 days ago

Total issues: 4
Total pull requests: 15
Average time to close issues: 1 day
Average time to close pull requests: about 2 months
Total issue authors: 4
Total pull request authors: 12
Average comments per issue: 2.25
Average comments per pull request: 0.87
Merged pull request: 8
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/fluent/sigdump

Top Issue Authors

  • JohnBat26 (1)
  • fatkodima (1)
  • yegor256 (1)
  • sonots (1)

Top Pull Request Authors

  • frsyuki (3)
  • mrkn (2)
  • Etsukata (1)
  • fatkodima (1)
  • richardmcmillen (1)
  • kares (1)
  • cosmo0920 (1)
  • yu74n (1)
  • mpalmer (1)
  • yui-knk (1)
  • ko1 (1)
  • sonots (1)

Top Issue Labels

Top Pull Request Labels


Package metadata

proxy.golang.org: github.com/fluent/sigdump

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/fluent/sigdump#section-documentation
  • Licenses: apache-2.0
  • Latest release: v0.2.5 (published over 2 years ago)
  • Last Synced: 2026-03-01T11:31:45.860Z (2 days ago)
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 3.746%
    • Forks count: 4.475%
    • Average: 7.15%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%

Dependencies

sigdump.gemspec rubygems
  • rake >= 0.9.2 development
Gemfile rubygems

Score: -Infinity