-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Jonathan,
On 5/12/20 05:51, Jonathan Yom-Tov wrote: > I have an application which changes the state of user sessions in > lots of places in the code. Is it possible to do a seamless switch > of Tomcat servers, preserving all sessions? > > I know I can use PersistentManager to persist sessions and load > them. I can think of two strategies: > > 1. Persist sessions periodically. This is more robust as I might > not have control of when the server shuts down. 2. Persist sessions > on server shutdown. > > > The problem with the first approach is that I might lose the latest > changes when the new server comes up. The problem with the second > is that I'll have to lock access to the session until the old > server is done saving it, which may make response times very slow. > > Is there a good solution to this that I might have overlooked? If you want to solve these problems: 1. Seamless (uninterrupted) restarts 2. Always up-to-date (well, as much as possible) 3. No downtime Then you really need a cluster where the sessions are being replicated around the cluster. This will solve some other problems as well: 4. Expected downtime (e.g. OS/Tomcat/application upgrade) 5. Unexpected downtime (network outage, hardware fault) 6. Scaling-out (either manually or automatically) You can do it with as little as two Tomcat instances. If you only care about being able to restart your application (and not the whole server, for example), then you can even run them side-by-side on the same server. You won't get protection against OS upgrades and unexpected downtime in that case, but you can get familiar with the setup without a whole lot of infrastructure. - -chris -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl66rKgACgkQHPApP6U8 pFjsChAAtKdo2Ow+X+Lb0JQLAOxijryxlsRtO3rvdRPJLUxVG4ttVGXuJ86cPX9g uRoyOrtgSw3N7mPMgL51B39Sp8GtB6zcjAiB4CQzOTXA3FiRN99Jna6dEVpCUcQx xAUBNuJh6Q5N/l1tpLYIMgKXEmhGcexplNTEVl8IAb5tppNy1LtjUVMG3C4NolI1 eKUVqNhtSmclBH9aDC94jlWLVH+OiKJhAfc965oCRv4E3vIcj5HGoKfK65iqFYPx hzOMUzvJfsHBfNMo0UyKvRiDIFyBUgeUEIAJZWAJojhTSHymYpQozYBDIjCfNHYa II6NYhYb9OuiwV9PEXFN2yZejBsgJvZzlbooWOg2z4nMmCItaTiUhOMyKNIY5wlz iXnh85yx/GMRSsiQrTD6X4cAwCsXusHwoF/WC0JncYr7hZw/mqwcXDnMhUAccOCc Z1l2x53yoVSH+RyoGgdG/DSWqLHZfiK/xr8UOtRbMD1WNfGOPo+GhpJBiSNSBeeS LMNiQbvZEcTKOsxUFgUDPwB62kbDyLnt765tgrSOWubBIaHXBctTNLtv9sjp6ARG DnNTmAtdk89UuhDA63iimDxx9jxDKsWKPz8Srf6RS7z8yUrlvFkfKQcIEaqHSLTr LnbrTHK2k92bJonJua5hDcuTgU7axEBlWmXxChyZWmYm2r1R76M= =suSa -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org