When enhancing application performance, should horizontal scalability or vertical scalability needs to be addressed first? What factors are needed to be exam before making the decision besides CPU, memory, workload? Does replacing slow cpu by fast cpu help? Thanks [ July 28, 2005: Message edited by: vu lee ]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Whoa - what a nice general question. What type of application are we talking about here? There are so many possibilities. What measure of performance? Perceived delay of first response? CPU utilization? Network load? Number of simultaneous users? That said, Java code can be written to utilize multi-core or multiple CPU systems very efficiently. Bill
Bill, This is an online shopping cart application using J2EE platform. The performance is measured by the throughput at peak time when a max number of requests specified in the requirement doc hits the app server. I have another general question, performance (1) vs extendability, managability, and maintainability (2). Most of J2EE patterns increase the (2) but reduce (1). I have heard many people said that there must be a balance between (1) and (2), but it's hard to determine where the balance is. My opinion is to achieve performance first and then perform refactory to achieve (2), but how do I know that this is the best possible performance this application can achieve.
Joined: Jul 11, 2001
Originally posted by vu lee: My opinion is to achieve performance first and then perform refactory to achieve (2)
It's actually much better to do it exactly the other way around. That is because performance optimization often goes at the cost of code structure, but a good code structure actually makes it easier to optimize performance.
but how do I know that this is the best possible performance this application can achieve.
Achieving the *best* performance almost never is an option, simply because it is too costly. What you need to find out is what performance you actually will *need*.
Joined: Jul 11, 2001
To add to my earlier post, once you know what performance you need, you should start with a system of a perfectly maintainable design, profile it to find the bottlenecks and work on improving those. That's the most cost effective way to get the performance you are looking for.
There are a few things that prevent horizontal scalability, mostly around sessions, stateful services and and any Single Point of Failure problems. If you think you'll ever need to move from running on one JVM to running on two to a million, you should consider what it takes to avoid those things.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi