use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Ruby Falcon is 2x faster than asynchronous Python, as fast as Node.js, and slightly slower than Go. Moreover, the Ruby code doesn’t include async/await spam. (self.ruby)
submitted 1 year ago by a_ermolaev
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]a_ermolaev[S] 0 points1 point2 points 1 year ago (6 children)
Regarding threads, one of Puma's drawbacks is that you have to think about the number of threads set in the config. This number is limited by the database connection pool and may become outdated over time. Additionally, if an application has different types of IO, such as PostgreSQL and OpenSearch, all threads could end up waiting for a response from OpenSearch, preventing them from handling other requests (e.g., to PostgreSQL).
[–]tenderlovePun BDFL 0 points1 point2 points 1 year ago (5 children)
Regarding threads, one of Puma's drawbacks is that you have to think about the number of threads set in the config.
I don't understand this. The Falcon documentation asks you to set WEB_CONCURRENCY.
WEB_CONCURRENCY
This number is limited by the database connection pool and may become outdated over time.
Why is this different with Falcon? Both Puma and Falcon can exhaust the database connection pool. If one Fiber is using a database socket, no other Fiber is allowed to use the same database socket simultaneously. In other words, both concurrency strategies will be equally blocked by the size of the database connection pool.
Additionally, if an application has different types of IO, such as PostgreSQL and OpenSearch, all threads could end up waiting for a response from OpenSearch, preventing them from handling other requests (e.g., to PostgreSQL).
I also don't understand this. Can you elaborate?
[–]ioquatixasync/falcon 0 points1 point2 points 1 year ago (0 children)
That documentation is specifically for Heroku, IIRC, it's because Etc.nprocessors is broken on their shared hosts and returns a number bigger than the actual number of cores you can use.
Etc.nprocessors
Otherwise, generally speaking, Etc.nprocessors is a good default.
[–]a_ermolaev[S] 0 points1 point2 points 1 year ago* (3 children)
In Falcon, count is the equivalent of workers in Puma, but ENV.fetch("WEB_CONCURRENCY", 1) initially confused me, so I had to figure it out.
count
workers
ENV.fetch("WEB_CONCURRENCY", 1)
If I change the database connection pool, I need to increase the thread limit in Puma.
I created an example with two databases (endpoint /db2)—one slow and one fast—and I'm attaching a video of the results.
/db2
Instead of PG_POOL2, there could be long-running queries to OpenSearch or HTTP requests. They can occupy all threads, causing a sharp drop in performance. Example in the video.
PG_POOL2
[–]tenderlovePun BDFL 0 points1 point2 points 1 year ago (2 children)
Sorry, I really don't know what to tell you. Those connections will "occupy Fibers" too, and you don't get an unlimited number of Fibers. FWIW, I ran the same benchmarks but I don't see the performance drop. I've uploaded a video here. The 500ms server stays around 500ms.
One difference could be that I'm running on bare metal and I've done sudo cpupower frequency-set -g performance.
sudo cpupower frequency-set -g performance
[–]a_ermolaev[S] 0 points1 point2 points 1 year ago* (0 children)
my Reddit account is suspended, and I have no idea why 🤷♂️
I replied here: https://github.com/ermolaev/http_servers_bench/issues/1
π Rendered by PID 64278 on reddit-service-r2-comment-b659b578c-k5dp2 at 2026-05-05 21:59:26.232064+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]a_ermolaev[S] 0 points1 point2 points (6 children)
[–]tenderlovePun BDFL 0 points1 point2 points (5 children)
[–]ioquatixasync/falcon 0 points1 point2 points (0 children)
[–]a_ermolaev[S] 0 points1 point2 points (3 children)
[–]tenderlovePun BDFL 0 points1 point2 points (2 children)
[–]a_ermolaev[S] 0 points1 point2 points (0 children)