Replies: 2 comments
-
Do you have a liveness probe running for your deployment? We had to make sure that our session middleware was excluded on the endpoint used for the K8S liveness probe (we create a simple keep-alive route), otherwise we would end up with the same as what you are describing; lots of empty session records in the database. |
Beta Was this translation helpful? Give feedback.
-
@adamkl is likely correct, if you have not set saveUninitialized to false, or otherwise avoided the liveness and readiness checks then kubernetes just checking to see if your node application is online is sending a request which sessions is by default creating an empty session for each of these requests. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Ok, I know there are a lot of settings that can affect things. I will explain the situation first, then wait for what information I should provide.
Here is my dep list for version info:
My nodejs 14+ app is sitting behind a kubernetes nginx-ingress controller. All cookies and site behavior is as expected, what I am seeing in the mongo db session store is new sessions being created about one a second on avg. The timing is not consistent. When I look in grafana to look at open connections, and connections/sec etc. They are zero. It LOOKs like there is no outside traffic coming in. Could the ngnix-ingress (with sticky option set) be causing this creation of sessions? Some sort of health check? I am happy to provide more configs just didn't want to overwhelm the initial question.
Beta Was this translation helpful? Give feedback.
All reactions