Vaadin Flow session memory keeps a low-traffic app on an oversized instance — is passivation viable?
0 reputation · 23 May 2020, 15:09 UTC
0 reputation · 23 May 2020, 15:09 UTC
A low-traffic Vaadin Flow application (assume Vaadin 24 on Spring Boot) costs more to host than its page-view count suggests. Because Flow holds each user's UI component tree in server memory tied to the HTTP session, instance sizing is driven by concurrent sessions and session timeout, not request volume. The goal is to move this workload to a smaller instance without breaking active user sessions.
The documented lever is session serialization/passivation: if the UI state is serializable, a servlet container or Spring Session (e.g., Redis or JDBC backend) can persist idle sessions externally, so memory only needs to cover genuinely active sessions. The uncertainty is that Vaadin views must not hold non-serializable fields (injected services, streams, lambdas capturing non-serializable state), and this application's views have not been audited. Silent failures here would force sessions to stay in memory anyway.
Secondary options under consideration: shortening the session timeout (at the risk of logging users out mid-task) and confirming that server push is not keeping idle WebSocket connections alive unnecessarily.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.