Please sign in to comment.
Reuse cached session in MRU order, not in LRU
MRU is more server friendly than LRU because it reduces number of cached sessions when a number of requests drops after an usaage spike. Closes #68. With reusing sessions in LRU order, all sessions are equally checked if it's closed or not, as far as there's a request to the same site. With reusing sessions in MRU order, old cold sessions are kept in cache long time even if there's a request to the same site. To avoid this leakage, this commit adds keep_alive_timeout property and let SessionManager scrub all sessions with checking the timeout for each session. When the session expires against the last used time, it's closed and collected. keep_alive_timeout is 15[sec] by default. The value is from the default value for KeepAliveTimeout of Apache httpd 2. This change is related to #56.
- Loading branch information...
Showing with 12 additions and 3 deletions.