3

I'm planning to use MemoryStore in production. My application doesn't care about lost session data after server restart & is small enough so there is no need for scaling. Taking that in count there is only one concern that I have left - warning that says: MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process.

Here is a suggestion of how it can be worked around: https://stackoverflow.com/a/10761522/4446128
Please note, at the time of writing, there is no answer to my question in linked question & I can't ask there because it requires 50 reputation which I don't have.

I set interval to log all sessions (.all method on MemoryStore) & I see that sessions are being cleaned up after expiration date - so I don't think that leak is happening, but not 100% sure. Can someone confirm that it is not an issue anymore or tell me that I'm wrong & leak is still happening? If leak can still happen, please explain why.

Also not 100% sure that is relevant, but I'm using passport for authentication, so maybe it is cleaning up sessions?
Thank you.

sergeyski.com
  • 586
  • 6
  • 14
  • Your question ends up being a duplicate of the question that you just linked. If there is no concern for memory leaks anymore, then the answers on the linked question should be updated. And regardless of that, you are advised to use something else in production. [Even the owners of express](https://github.com/expressjs/express/issues/917#issuecomment-3003533) say so. – E_net4 Jun 25 '17 at 21:03
  • Now I have to explain myself, as your comment makes my question almost irrelevant to some people, I even got a downvote... In order to ask in other question I need 50 reputation which I don't have, so I need to create a question on my own. And my question was detailed enough to get an answer better than - you're advised to use something else in production, I explained why very well. I'll even accept (personally, not in SO terms) your answer if you answer it in original thread. Just give me a chance to ask on SO, please! – sergeyski.com Jun 26 '17 at 01:16

0 Answers0