Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning in production env #1187

Closed
jashsayani opened this issue Dec 10, 2013 · 6 comments
Closed

Warning in production env #1187

jashsayani opened this issue Dec 10, 2013 · 6 comments

Comments

@jashsayani
Copy link

The application worked fine in prod, but when I switched from EJS to Handlebars, I started getting the following error on sails lift (in prod):

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

@bhanuc
Copy link

bhanuc commented Dec 10, 2013

Are you using any session store ?

@mikedevita
Copy link
Contributor

This isn't an issue. You haven't defined anything in config/session.js as a result sails defaults to memory for session storage.. its just warning you, as it can be a performance hog. When you set your NODE_ENV=production or you tell sails the environment: 'production' it auto generates this warning if you haven't set a session store up.

In a production env you should use something like redis, which is what SailsJs is built to use... See the docs here.

More specifically config/session.js outlines this information as comments.

@pixelfreak
Copy link

@mikedevita I have a follow-up question about this. I am not using any session in my code so how can I make sure there won't be memory leak in prod? Should I just ignore this warning?

@gotmikhail
Copy link

Should I still get this warning if I have session middleware disabled altogether?

gleam-ru added a commit to gleam-ru/heroku that referenced this issue Oct 5, 2015
@mikermcneil
Copy link
Member

For future reference, there's more information and tips on diagnosing memory leaks in Node apps, and on reproducing+reporting suspected memory leaks in Sails here:
#3782 (comment)

@balderdashy balderdashy locked and limited conversation to collaborators Aug 9, 2016
@mikermcneil
Copy link
Member

Also, see sailsjs.org/documentation/concepts/deployment for more info on deploying to production.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

7 participants