socketry / falcon

A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.
https://socketry.github.io/falcon/
MIT License
2.54k stars 79 forks source link

Concurrent Database Transaction worries #214

Closed buhrmi closed 6 months ago

buhrmi commented 6 months ago

Hi there,

I've been testing Falcon since a few days and am pretty much in awe what has been accomplished here.

However, I've stumbled upon this comment on Hackernews regarding the per-thread nature of the pg gem and the issues with concurrent transactions.

So basically, my question is if this has already been addressed in some way or is this still an issue? What would we need to do to fix this? Write a new adapter using the db-postgres gem? Been looking at the examples in the readme and it doesn't mention concurrent transaction, only concurrent queries. So right now I'm hoping I can get a bit of advice how to proceed. Would it be wise to switch back to puma while concurrent transactions are still being worked on?

ioquatix commented 6 months ago

Use the latest version of Rails with per-fiber concurrency.

https://blog.saeloun.com/2022/02/23/rails-fiber-safe-connection-pools/

buhrmi commented 6 months ago

Oh wow, you guys rock so much