App slowdown under high load
During Jonetsu's anime event we experienced big slowdowns under a lod of about 20 users.
It's abnormal for a webapp (it was affecting the player's ability to change songs too) and was likely caused by SQLite3's lack of concurrent performance.
better-sqlite3 could be used in stead of node-sqlite3 but :
- We'd need to design a migration system
- We'd need to rewrite part of the DAO code, or provide our own wrapper to make it transparent. Better-sqlite3 only works with prepared statements.
- better-sqlite3 requires python 2.7 for building, which we'll have to experiment with.
The module also gives us some interesting ideas, like putting the journal mode in WAL (write after log) instead of the default mode which is not suited for concurrent access.
Another idea suggested by @bcourtine involves us shipping a mysql/postgresql server only with a special version of Karaoke Mugen built for events. Not a bad idea per se, but I'd like it to be a last resort if we can't get sqlite3 to bheave.