ExpressGateway / express-gateway

A microservices API Gateway built on top of Express.js
https://www.express-gateway.io
Apache License 2.0
2.98k stars 348 forks source link

MemoryStore is not designed for production environment #935

Closed mario-grgic closed 5 years ago

mario-grgic commented 5 years ago

Installed latest version of express-gateway (1.16.7). Set the variable export NODE_ENV=production, started express-gateway and got:

Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
2019-08-20T22:32:29.800Z [EG:gateway] info: gateway http server listening on :::8080
2019-08-20T22:32:29.800Z [EG:admin] info: admin http server listening on 127.0.0.1:9876

Is there anything I can do to control session store in production environment?

XVincentX commented 5 years ago

In general, you should probably not rely on the memory store in production. The best thing is to offload this to a good backing store such as Redis.

See the documentation page