Thursday, 11 May 2017

Application deployed on AppEngine populates session table like crazy

I just deployed a Node.JS application on Google AppEngine and notice that it keeps on creating sessions in my DB. I'm using MongoDB Atlas for DB and expressSession to store session in the MongoDB.

The app is running for around 10 minutes now and meanwhile I notice 16000+ session objects in the DB. It's a new projects on AppEngine so I don't think it's a bot or anything accessing it because the project didn't exist before...

Here's the session config:

app.use(expressSession({
    secret: "SECRET",
    cookie: {maxAge: 60*6000*1000},
    store: new mongoStore({ mongooseConnection: mongoose.connection }),

    resave: true,
    saveUninitialized: false
}));

At the moment this is causing a huge problem because in a matter of an hour or so the data reaches my quota and I can no longer query the DB until I remove all the objects.

I also checked the logs in appEngine and don't see any other requests except for the ones I make from my browser...

Anybody a clue what could cause that behavior?



via Passero

No comments:

Post a Comment