Thanks Chris and David for reply. I did change the timeout values from 30 to 10.
I have some workflow kind of screens,but I do not store work flows fields data in session. Session contains only attributes which are similar to ids. All data is persisted in the mysql database and I get the data from the database. I do have some performance issues with mysql,but that can wait for sometime. (I believe the default maximum is 10,000 I hope this should be for single instance of tomcat and If I use cluster, this limit will not apply. 5K is my break even point for my app, So I think I can live with this default. However it will be good to know if this limit can be changed somehow. Sorry for delayed response, was bit held up firefighting in office. - Kiran On Mon, Sep 14, 2015 at 10:37 AM, Christopher Schultz < ch...@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Kiran, > > On 9/13/15 8:40 PM, Kiran Badi wrote: > >> Perhaps you should think about using a leaner session, and then > >> sessions living for longer than necessary won't be such a big > >> problem > > > > What do you mean by leaner session ? Storing less objects in > > session or changing default timeout from 30 mins to something of > > less value ? > > I mean storing a lower total number of bytes in the session. For > instance, you can either store an Integer "id" for an object graph > located in a database in the session, or you can store the whole > object graph itself in the session. Storing only the id saves you a > lot of memory but then you need to load the objects from the db to > actually use them. Storing the object graph in the session makes your > application faster, but it will consume much more memory. > > If you can afford the slow-down, then a single server can handle many > more logged-in users if you store only the ids in the session. > > > I think got probable answer to my issue, I had overlooked the JSP > > part, I have JSP's and by default JSP creates session, and this was > > reason as why I was seeing thousands of session in my app. > > Perhaps. You should only create a session when necessary. An empty > session does not take up much memory, but you should take care not to > create too many of them (I believe the default maximum is 10,000). > > > Is their a way to kill the session after certain period of inactive > > time where user is not doing anything on the site or I need to > > adjust my timeout value ? > > The timeout value *is* the way to kill inactive sessions. It can be > set in web.xml. > > - -chris > -----BEGIN PGP SIGNATURE----- > Comment: GPGTools - http://gpgtools.org > > iQIcBAEBCAAGBQJV9tuYAAoJEBzwKT+lPKRYhlkP/1k87UfGFrmkMYPTmUgEmVqz > 1R6GQFSP4QJKmad+yTSDFWQBoFDKrO3C6NTBicawgjS/gQ4oLatJQUHZTK+ywSeM > SDmZ2yOwSgzQ2trnbqpD0dENf0gp3rOQdzdNE5a8JOozhEO3oZglkIKnP1dLyoml > I8iijVU61tGJZMfKTVDbTkTOxhTHd0G4kDHCqxTSwpVCC7qFWHWr49AhUeanWBZr > jGezka2ZNV+aKh5bEOHH3Lh8EEIYxTrXpCtm1MZayOV1JmaOi74RByiC9AUjbtPg > z5NsAvVMwqiTWJ1XrL7Y56GQ1IfdUhfBpDg32OnvUuparwCq0hu35dw0RuidElOw > BpE4MRvuRobsZEo4aF+LOA7kyKk0R2hFRIYBaH8yTWf4S7hUVXmYAdNDT4fcR27U > KDoMoEGH+qp+8cLZRrjCNUIwEu1dxBMJOe6Hk1v1aVnCiixB4z/ywjp4jfF7uBXm > vG8j4k9ozriWHpJxinmV0/LTGBOiCI7xYbjVBmXnpsNdzpd9pFLacyh6X6fFQO8D > jbV1zIzVN/VKDD3fGMoSm+/dj91QgIAUbvJbEDBZZtS4imuji3FNfiEprBiPDB6b > iG4RyS33M6xRNEVkIDu0bflXIyW6HzVcdMtwOAbMH3Pv6L9SkqBJaTSUCGaitah1 > ZJ4u/nTH6eKxFFRjHgkr > =oCoO > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >