A summary of data about the Ruby ecosystem.

https://github.com/zombocom/rack-timeout

Abort requests that are taking too long
https://github.com/zombocom/rack-timeout

Keywords from Contributors

activerecord activejob mvc rubygems feature-flag rack rubocop crash-reporting code-formatter static-code-analysis

Last synced: about 21 hours ago
JSON representation

Repository metadata

Abort requests that are taking too long

README.md

Rack::Timeout

Abort requests that are taking too long; an exception is raised.

A timeout of 15s is the default. It's recommended to set the timeout as
low as realistically viable for your application. You can modify this by
setting the RACK_TIMEOUT_SERVICE_TIMEOUT environment variable.

There's a handful of other settings, read on for details.

Rack::Timeout is not a solution to the problem of long-running requests,
it's a debug and remediation tool. App developers should track
rack-timeout's data and address recurring instances of particular
timeouts, for example by refactoring code so it runs faster or
offsetting lengthy work to happen asynchronously.

Upgrading

For fixing issues when upgrading, please see UPGRADING.

Basic Usage

The following covers currently supported versions of Rails, Rack, Ruby,
and Bundler. See the Compatibility section at the end for legacy
versions.

Rails apps

# Gemfile
gem "rack-timeout"

This will load rack-timeout and set it up as a Rails middleware using
the default timeout of 15s. The middleware is not inserted for the test
environment. You can modify the timeout by setting a
RACK_TIMEOUT_SERVICE_TIMEOUT environment variable.

Rails apps, manually

You'll need to do this if you removed Rack::Runtime from the
middleware stack, or if you want to determine yourself where in the
stack Rack::Timeout gets inserted.

# Gemfile
gem "rack-timeout", require: "rack/timeout/base"
# config/initializers/rack_timeout.rb

# insert middleware wherever you want in the stack, optionally pass
# initialization arguments, or use environment variables
Rails.application.config.middleware.insert_before Rack::Runtime, Rack::Timeout, service_timeout: 15

Sinatra and other Rack apps

# config.ru
require "rack-timeout"

# Call as early as possible so rack-timeout runs before all other middleware.
# Setting service_timeout or `RACK_TIMEOUT_SERVICE_TIMEOUT` environment
# variable is recommended. If omitted, defaults to 15 seconds.
use Rack::Timeout, service_timeout: 15

Configuring

Rack::Timeout takes the following settings, shown here with their
default values and associated environment variables.

service_timeout:   15     # RACK_TIMEOUT_SERVICE_TIMEOUT
wait_timeout:      30     # RACK_TIMEOUT_WAIT_TIMEOUT
wait_overtime:     60     # RACK_TIMEOUT_WAIT_OVERTIME
service_past_wait: false  # RACK_TIMEOUT_SERVICE_PAST_WAIT
term_on_timeout:   false  # RACK_TIMEOUT_TERM_ON_TIMEOUT

These settings can be overridden during middleware initialization or
environment variables RACK_TIMEOUT_* mentioned above. Middleware
parameters take precedence:

use Rack::Timeout, service_timeout: 15, wait_timeout: 30

For more on these settings, please see doc/settings.

Further Documentation

Please see the doc folder for further documentation on:

Additionally there is a demo app
that shows the impact of changing settings and how the library behaves
when a timeout is hit.

Contributing

Run the test suite:

bundle
bundle exec rake test

Compatibility

This version of Rack::Timeout is compatible with Ruby 2.3 and up, and,
for Rails apps, Rails 3.x and up.


Copyright © 2010-2020 Caio Chassot, released under the MIT license
http://github.com/zombocom/rack-timeout


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 23 hours ago

Total Commits: 231
Total Committers: 38
Avg Commits per committer: 6.079
Development Distribution Score (DDS): 0.636

Commits in past year: 5
Committers in past year: 4
Avg Commits per committer in past year: 1.25
Development Distribution Score (DDS) in past year: 0.6

Name Email Commits
Caio Chassot d****v@c****m 84
Caio Chassot c****o@h****m 56
Jonathan Dance jd@w****m 27
schneems r****o@g****m 13
Olle Jonsson o****n@g****m 4
mishina t****8@g****m 4
Lee Reilly l****e@l****t 4
André Luis Leal Cardoso Junior a****r@g****m 3
Akira Matsuda r****e@d****p 3
Maxim Polunin m****n@g****m 2
Jon Dufresne j****e@g****m 2
Mark Allen m****n@v****m 2
John Bachir j****b 2
Joe Johnston j****e@c****e 1
Abir Majumdar a****r@l****m 1
Andrew Harvey a****w@m****m 1
Andrew Nesbitt a****z@g****m 1
Bojan Marjanovic m****3@g****m 1
Dan Buettner d****n@d****t 1
tore g. eschliman t****n@g****m 1
dependabot[bot] 4****] 1
bobbus a****o@g****m 1
Vital v****o 1
Tom de Vries t****v 1
Sjors Provoost s****s@s****l 1
Sindre Moen s****m@g****m 1
Ryan L. Cross r****s@g****m 1
Richard Huang f****m@g****m 1
Peter Goldstein p****n@g****m 1
Pavlo p****k@g****m 1
and 8 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 9 days ago

Total issues: 60
Total pull requests: 79
Average time to close issues: about 1 year
Average time to close pull requests: 6 months
Total issue authors: 53
Total pull request authors: 32
Average comments per issue: 5.6
Average comments per pull request: 1.77
Merged pull request: 49
Bot issues: 0
Bot pull requests: 1

Past year issues: 2
Past year pull requests: 6
Past year average time to close issues: about 10 hours
Past year average time to close pull requests: 10 days
Past year issue authors: 2
Past year pull request authors: 4
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.17
Past year merged pull request: 3
Past year bot issues: 0
Past year bot pull requests: 1

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/zombocom/rack-timeout

Top Issue Authors

  • kch (3)
  • collimarco (3)
  • wuputah (2)
  • dentarg (2)
  • RaviAsnani (2)
  • Samsinite (1)
  • katyho (1)
  • majioa (1)
  • dbackeus (1)
  • stevenjonescgm (1)
  • ankane (1)
  • kaoru (1)
  • mintuhouse (1)
  • myfitment (1)
  • MarcusPetri (1)

Top Pull Request Authors

  • olleolleolle (10)
  • schneems (8)
  • jjb (7)
  • wuputah (7)
  • jdufresne (4)
  • TSMMark (4)
  • amatsuda (3)
  • dentarg (3)
  • Capncavedan (2)
  • toregeschliman (2)
  • mikegee (2)
  • andrew (2)
  • mishina2228 (2)
  • boimw (2)
  • petergoldstein (2)

Top Issue Labels

  • in progress (1)

Top Pull Request Labels

  • skip changelog (2)
  • dependencies (1)
  • github_actions (1)

Package metadata

gem.coop: rack-timeout

Rack middleware which aborts requests that have been running for longer than a specified timeout.

  • Homepage: https://github.com/zombocom/rack-timeout
  • Documentation: http://www.rubydoc.info/gems/rack-timeout/
  • Licenses: MIT
  • Latest release: 0.7.0 (published almost 2 years ago)
  • Last Synced: 2026-03-02T04:01:52.877Z (1 day ago)
  • Versions: 30
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 100,231,771 Total
  • Docker Downloads: 462,828,224
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.122%
    • Docker downloads count: 0.232%
    • Downloads: 0.256%
  • Maintainers (3)
rubygems.org: rack-timeout

Rack middleware which aborts requests that have been running for longer than a specified timeout.

  • Homepage: https://github.com/zombocom/rack-timeout
  • Documentation: http://www.rubydoc.info/gems/rack-timeout/
  • Licenses: MIT
  • Latest release: 0.7.0 (published almost 2 years ago)
  • Last Synced: 2026-03-02T07:31:33.650Z (1 day ago)
  • Versions: 30
  • Dependent Packages: 14
  • Dependent Repositories: 4,330
  • Downloads: 100,237,524 Total
  • Docker Downloads: 462,828,224
  • Rankings:
    • Docker downloads count: 0.287%
    • Downloads: 0.339%
    • Dependent repos count: 0.477%
    • Average: 1.113%
    • Dependent packages count: 1.446%
    • Stargazers count: 2.015%
    • Forks count: 2.115%
  • Maintainers (3)

Dependencies

rack-timeout.gemspec rubygems
  • rack-test >= 0 development
  • rake >= 0 development
  • test-unit >= 0 development
.github/workflows/check_changelog.yml actions
  • actions/checkout v3 composite
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite
Gemfile rubygems

Score: 31.30618478761923