I don't see why you would have so many sessions? Doesn't the poll have it's own session? Or are you polling using all known existing session IDs?
The sessions will be read in from disk as needed, but will then stay in the cache until they expire. As you are polling at a higher rate than the session expiry time they will never expire and stay in the cache. You could try adjusting some of the cache settings to do with eviction so the session won't take up memory, but will remain on disk. Jetty will periodically check for expired sessions on disk, and also at start up. However, as you have set a long expiry and are actively keeping these sessions fresh by polling, it's unlikely many of the sessions will be removed. Jan On Fri, 29 Apr 2022, 02:46 Wang Yicheng, <wangyicheng1...@gmail.com> wrote: > Hi team, > > We're using the session-store-file module to persist all sessions on disk. > Recently we added a polling service to issue a request every second to the > server. Since we deliberately set a very long time-out, it now leaves tons > of session files and never gets purged. We were thinking of limiting the > total number of sessions under the same user. Thus we created a <user name, > session ID> map to track that. However, this would not work throughout the > server restart. > > Thus, I'm wondering if you could help with the following questions. > 1. Will Jetty load all persisted sessions into memory during start-up, or > is it a on-demand fashion? > 2. If the answer to Q1 is "yes", is there a function that we can > piggy-back into? > 3. If the answer to Q1 is "no", is there a way to forcibly load in all > persisted sessions? > > Btw, we're still on the Jetty 9 branch. We're aware of the upcoming EOL > and have planned an upgrade :) > > Many thanks in advance! > > Best, > Yicheng > _______________________________________________ > jetty-users mailing list > jetty-users@eclipse.org > To unsubscribe from this list, visit > https://www.eclipse.org/mailman/listinfo/jetty-users >
_______________________________________________ jetty-users mailing list jetty-users@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users