Express.js Book - Express Web Application Development » Topic: Cluster with session warning mesg http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/feed/ Sat, 16 May 2015 19:57:39 +0000 http://bbpress.org/?v=2.5.4-5380 en-US http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/#post-83 <![CDATA[Cluster with session warning mesg]]> http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/#post-83 Sun, 25 Aug 2013 08:40:21 +0000 gdbtek If I use cluster with app.use(express.session());, I will get following warning mesg.

Warning: connection.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.

so does it means that I should not use session for cluster? Is there any workaround?

Thanks

]]>
http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/#post-84 <![CDATA[Reply To: Cluster with session warning mesg]]> http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/#post-84 Mon, 26 Aug 2013 08:29:39 +0000 Yaapa MemoryStore is used for storing session data by default, which uses the app process’ memory. Since cluster processes can’t share session data, they will all be working with their own individual copies of session. This will result in a very erratic behavior from the app.

The workaround is to use an external memory store like RedisStore or MongoStore. You can read the details on page 184-185.

]]>
http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/#post-89 <![CDATA[Reply To: Cluster with session warning mesg]]> http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/#post-89 Mon, 26 Aug 2013 18:03:20 +0000 gdbtek Thanks Yaapa!

]]>
http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/#post-96 <![CDATA[Reply To: Cluster with session warning mesg]]> http://expressjs-book.com/forums/topic/cluster-with-session-warning-mesg/#post-96 Tue, 27 Aug 2013 05:15:45 +0000 Yaapa Most welcome!

]]>