Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    J

    JP Camara

    jpcamara.com · Personal blog · on HN since 2023

    JP Camara writes about Ruby internals, concurrency, and PostgreSQL connection pooling with PgBouncer.

    Visit blogRSSHN submissions
    ProgrammingLanguages & CompilersDatabases
    What HN says

    Commenters call his Ruby speedup breakdown phenomenal and his PgBouncer post great, saying it explains a complicated situation the PgBouncer docs cover poorly.

    Stats for nerds
    19HN people shared it
    23linked in comments
    927story points
    Feb 2026last shared
    2023people per year2026

    Top posts on HN

    1. 1
      Speeding up Ruby by rewriting C in Ruby
      4 people · 297 points · first shared 2024 · 121 comments on HN
    2. 2
      Ruby methods are colorless
      3 people · 195 points · first shared 2024 · 235 comments on HN
    3. 3
      The /o in Ruby regex stands for "oh the humanity "
      1 person · 186 points · first shared 2025 · 42 comments on HN
    4. 4
      In-Depth Ruby Concurrency: Navigating the Ruby Concurrency Landscape
      1 person · 166 points · first shared 2024 · 17 comments on HN
    5. 5
      Peephole optimizations: adding `opt_respond_to` to the Ruby VM, part 4
      1 person · 38 points · first shared 2024 · 2 comments on HN
    6. 6
      Calculating the largest known prime in Ruby
      1 person · 23 points · first shared 2024 · 10 comments on HN
    7. 7
      PgBouncer is useful, important, and fraught with peril
      9 people · 9 points · first shared 2023 · 1 comments on HN
    8. 8
      Bitmasks, Threads, and Interrupts: Concurrent, Colorless Ruby
      2 people · 3 points · first shared 2025 · Discussion on HN
    9. 9
      When good threads go bad
      2 people · 3 points · first shared 2025 · Discussion on HN
    10. 10
      The Thread API: Concurrent, Colorless Ruby
      1 person · 3 points · first shared 2024 · Discussion on HN

    What HN people wrote when they linked it

    • zzzeekSep 2023

      what a great post, we have had a ton of issues with users using pgbouncer and it's not because things are "broken" per se, it's just the situation is very complicated, and pgbouncer's docs are also IMO in need of updating to be more detailed and in a few critical cases less misleading, specifically the prepared statements docs.

      This blog post refers to this misleading nature at https://jpcamara.com/2023/04/12/pgbouncer-is-useful.html#prepared-statements .

      > PgBouncer says it doesn’t support prepared statements in either PREPARE or protocol-level format. What it actually doesn’t support are named prepared statements in any form.

      IMO that's still not accurate. You can use a named prepared statement just fine in transaction mode. start a transaction (so you aren't in autocommit), use a named statement, works fine. you just can't use it again in another transaction, because it will be "gone" (more accurately, "unmoored" - might be in your session, might be in someone else's session). Making things worse, when the prepared statement is "unmoored", its name can then conflict with another client attempting to use the same name.

      so to use named prepared statements, you can less ideally name them with random strings to avoid conflicts, or you can DEALLOCATE the prepared statement(s) you used at the end of your transaction. for our users that use asyncpg, we have them use a uuid for prepared statements to avoid these name conflicts (asyncpg added this feature for us here:…

    • btownFeb 2026

      You don't need multiple postmasters to spawn connection processes, if you have a set of Postgres proxies each maintaining a set pool of long-standing connections, and parceling them out to application servers upon request. When your proxies use up all their allocated connections, they throttle the application servers rather than overwhelming Postgres itself (either postmaster or query-serving systems).

      That said, proxies aren't perfect. https://jpcamara.com/2023/04/12/pgbouncer-is-useful.html outlines some dangers of using them (particularly when you might need session-level variables). My understanding is that PgDog does more tracking that mitigates some of these issues, but some of these are fundamental to the model. They're not a drop-in component the way other "proxies" might be.

    • molfMay 2025

      C itself is fast; it's calls to C from Ruby that are slow. [1]

      Crossing the Ruby -> C boundary means that a JIT compiler cannot optimize the code as much; because it cannot alter or inline the C code methods. Counterintuitively this means that rewriting (certain?) built-in methods in Ruby leads to performance gains when using YJIT. [2]

      [1]: https://railsatscale.com/2023-08-29-ruby-outperforms-c/ [2]: https://jpcamara.com/2024/12/01/speeding-up-ruby.html

    • hahahacornFeb 2025

      There's a phenomenal breakdown by JPCamara (https://jpcamara.com/2024/12/01/speeding-up-ruby.html) on why the Ruby#each method was rewritten in Ruby (https://bugs.ruby-lang.org/issues/20182). And bonus content from tender love: https://railsatscale.com/2023-08-29-ruby-outperforms-c/.

      TL;dr - JIT rules.

    • jashmatthewsAug 2024

      Best to just forget about it and listen on a connection not using pooling.

      https://jpcamara.com/2023/04/12/pgbouncer-is-useful.html#listen-notify

    • SomeoneAug 2025

      Possibly https://railsatscale.com/2023-08-29-ruby-outperforms-c/ or https://jpcamara.com/2024/12/01/speeding-up-ruby.html

    Related

    Rails at Scalerailsatscale.com59 people

    Tiny JITs for a Faster FFI

    Rails at Scale
    Company · last shared 2026
    Vidar Hokstadhokstad.com36 people

    Docker Development Patterns

    Vidar Hokstad
    Personal · last shared 2025
    Manish Goregaokarmanishearth.github.io97 people

    Picking Apart the Crashing iOS String

    Manish Goregaokar
    Personal · last shared 2026
    Niko Matsakissmallcultfollowing.com221 people

    Towards a Rust Foundation

    Niko Matsakis
    Personal · last shared 2026
    Ruby Insiderubyinside.com147 people

    Sinatra 1.0 Released: Major Milestone for Ruby’s Best Webapp DSL

    Ruby Inside
    Publication · last shared 2021
    Koichi Sasadaatdot.net/~ko115 people

    What's New in Ruby 2.1 [pdf]

    Koichi Sasada
    Personal · last shared 2025
    Merbistmerbist.com38 people

    Hey Apple, Please Be Nice and Share MacRuby

    Merbist
    Personal · last shared 2013
    byrootbyroot.github.io36 people

    There isn't much point to HTTP/2 past the load balancer

    byroot
    Personal · last shared 2026