midori-rb / midori.rb

Lightweight, Flexible and Fast Ruby Web Framework
MIT License
870 stars 57 forks source link

Fix SQL connections #79

Closed dsh0416 closed 7 years ago

dsh0416 commented 7 years ago

The problem causes the disconnection of SQLs made by three parts.

  1. Sequel doesn't auto reconnects when failed.
  2. nio4r returns EOF instead of Exceptions when registering an I/O event repeatedly.
  3. nio4r checks the repeat I/O registration on "Ruby Object" layer, when using IO::open(fd), there would be a new ruby object wouldn't raise error on nio4r. SQL drivers implemented from C extensions with fd as integer but not ruby object, so that the bug happens.
dsh0416 commented 7 years ago

The MySQL connection problems has solved. With a SQL query, midori could still get 2000 req/s on single core and single thread, 13x faster than rails.