aspose file tools
The moose likes Performance and the fly likes Performance improvment - how to get started? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Performance improvment - how to get started?" Watch "Performance improvment - how to get started?" New topic

Performance improvment - how to get started?

ambika mullasseri

Joined: Jun 01, 2009
Posts: 28
I have an application that runs on jboss 5, uses struts2 ,JAXB, Apache HTTP client to contact other servers in business logic, oracle db for some select operations and insertion of logs.There is a heavy use of concurrent hashmap for session management,there is lot of static data being cached in servletcontext too .the TPS that i get now is around 150 TPS and the requirement is to get 3000 TPS,

1. is this realistic?
2. what are the things i can start looking at?

using java 5 now

Thanks for any pointers and help

SCJP 6.0 86%
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11652

The first step with performance improvement is always to run a profiler, and find out where your code is actually spending the time. It does no good to try and improve your algorithm if you are always waiting on disk access.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 430

Profiler as previously stated is top suggestion but also consider doing some gc logging (JVM option) and visualize it, just to check your not doing a lot of full gc etc.

After that profile your DB queries and look at what OS gives you eg iostat etc

"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
Tushar Kapila
Ranch Hand

Joined: Dec 23, 2007
Posts: 35

3000 TPS with one server node? that does not sound very optimistic. there are limits on harware too - sockets a server can use, ram, cpu ... 150 seems to be pretty good.

most of the profilers i have used work better with java 6, so maybe you could look at migrating.

when we had we used selenoium to make a test suite for the web app, a few unit tests, migrated to java 6, then ran the suite again. we did not have any issues except for some entries in the jvm as we use a hsm server ...

but automated testing helped verify that.

we use a lot of cached data too - in static hash maps - they are okay as long as they are load once or load occsaionally read many times. but you mentioned " concurrent hashmap for session management,there is lot of static data being cached in servletcontext"

do you start any threads/ java timers or use jms in the same jvm -> should be fine as long as other threads dont write to the same context or maps. again a profiler would help if there are issues.

Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

Another important step in improving performance is to identify measurable requirements. Although performance improvement often starts with somebody complaining that something "feels slow", when it comes time to do the work, you need a measurable goal, such as "at most N seconds to render a page", or "at least N transactions per second", etc. Without one, it's hard to compare different approaches and hard to know when to stop.
It is sorta covered in the JavaRanch Style Guide.
subject: Performance improvment - how to get started?