- application.rb (
bundle exec thin start
bundle exec thin start --threaded
compare behavior when refreshing http://0.0.0.0:3000/mycontroller/slow and http://0.0.0.0:3000/mycontroller/fast. When running without threads, fast will always have to wait for slow. When running with threads, you can refresh fast with wild abandon while waiting for a request to slow to finish.
ab -n 1000 -c 10 http://0.0.0.0:3000/mycontroller/fast
Threaded mode is successfully asynchronous, but serves fewer requests per second.
- Is anyone in the world doing this in production?
- How does thin decide how many threads to create?
- What is the space complexity of each thread?
- Why is threaded slower? (MRI 1.9.2 and 1.9.3)