Watts-Lab/surveyor

Performance Issues With Concurrent Users On Surveys

Closed this issue · 2 comments

In my testing, the number of concurrent user that can be supported seems to be far less than previously. You seemingly can open many sessions of the surveyor.seas.upenn.edu home page, but anything dealing with a stateful survey can only support around 5 users. This is likely due to cookie storage being in memory. By default, express uses in-memory cookies, but this isn't great practice, so the solution is likely is to just connect a database store.

https://mianlabs.com/2018/05/22/using-mongodb-for-quick-session-storage-with-connect-mongo-in-express/

Additionally, we also should start scaling with pm2
https://expressjs.com/en/advanced/best-practice-performance.html

I'll give an update soon if that fixes it.

@markwhiting
#87 was actually not a real issue. It was a csv missing a space. Regardless, I think we should use database store with sessions. I tested it on the server, and it seem functional and surveys seemed snappier.

I'm happy to not merge this fix.