• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Tomcat session performance

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a tomcat/apache/mysql based system where the most of the usage is users on the site searching for other users. Previously, if a user search returned large amount of results, we would display a subset of the results and when the user clicked "next" or "prev" the search query would be run again but display the next (or prev) subset. This turned out to be too much of a hit on the db.

The solution we are using now is to have the search results return an array of user ids (of type long) and that array is stored in the session with a key based on the search parameters. So you execute the query once and grab the array from the session when you page through the results.

Now it seems our new scheme is putting a tremendous strain on Tomcat. It doesn't seem to be running out of memory so one of our engineers thinks it is due to garbage collection. I'm not sure if this makes sense, but I don't have any really good arguments against it either. Should having a large number of arrays of longs stored in sessions create that much of a performance problem? These arrays are never have more than 2000 user ids in them, so memory doesn't seem like it would be an issue. Are there possibly jvm parameters that might improve garbage collection performance? Or is storing stuff in the session with tomcat just a very resource intensive thing even if the objects being stored are not very large?

Thanks....
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
define "tremendous strain on Tomcat" for us.

It takes to long to load a page now? Have you profiled your application to see what parts take the longest time?

There might be some in-efficiences with how the array of longs is being accessed/used.
 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic