rawberg / connect-sqlite3

SQLite3 session store for connect and express.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQLITE_BUSY errors when running multiple processes

nathanieltagg opened this issue · comments

Hi,
I'm new to clustering. I opted to try pm2 as my clustering method, since that seemed easiest. However, this yields a lot of errors like:
Error: SQLITE_BUSY: database is locked

It also appears that many times, the session isn't being retrieved. I can see that the ./session file is getting updated, though.

I'm guessing that what's happening is that many small files are being accessed all at once, and that is logjamming the server, but I can't tell.

Do I have something misconfigured, or is this a limitation of the store?

Have you tried with { concurrentDB: true } ?
eg.
var sqlStore = new SQLiteStore( { dir: config.volume, db: 'sessions.db', concurrentDB: true })