Archive for December, 2007

378 CHAPTER 15 NEXT STEPS You have

Thursday, December 13th, 2007

378 CHAPTER 15 NEXT STEPS You have many log file analyzers to choose from (more than 100 are available at the time of this writing) here s just a sampling: WebTrends: www.webtrends.com Quest s Funnel Web Analyzer: www.quest.com/funnel_web_analyzer SPSS s Predictive Web Analytics: www.spss.com/pwa The Webalizer: www.mrunix.net/webalizer WebSTAT: www.webstat.com For more advanced cases where business functionality cannot be determined by looking at the URL itself, an end-user experience monitor can provide the insight that you need. You can configure the monitor to understand your business processes, so that rather than presenting a set of disparate requests, it can assign business values to those requests. The only tools in this market are Quest s Foglight Experience Monitor (www.quest.com/ foglight_experience_monitor) and Quest s Foglight Experience Viewer (www.quest.com/ foglight_experience_viewer). These tools boast the ability to gather deep information and present it in the context of your business processes with 0 percent overhead because they simply sniff network traffic as it occurs and redirect information to a central analysis engine while the request is processed by the Web server. Online Communities To support this book, as well as to continue my efforts to promote formal performance management and effect positive change in Java EE performance, I have launched a Web community at www.javasrc.com. On JavaSRC, you will find active discussions around performance tuning and performance management, links to the latest vendor products, sample code and tools, articles and white papers, and online education. At the time of this writing the community is under development, but my aim is that by the time you get this book home (or it arrives from your favorite online e-tailer), the site will be moving full-steam ahead. In addition to running JavaSRC, I publish weekly articles, many of which are performance related, on www.informit.com in the Java Reference Guide. Finally, here are links to sites that I visit on a regular basis to find performance-related discussions: TheServerSide.com: www.theserverside.com Java Performance Tuning: www.javaperformancetuning.com Sun Developer Network (SDN): http://developers.sun.com Java.net: www.java.net dev2dev (BEA s developer site): http://dev2dev.bea.com IBM developerWorks: http://www-128.ibm.com/developerworks JBoss Forums (especially the Performance Tuning forum): www.jboss.org
We recommend high quality webhost to host and run your jsp application: christian web host services.

Database web hosting - CHAPTER 15 NEXT STEPS business value and

Wednesday, December 12th, 2007

CHAPTER 15 NEXT STEPS business value and determine a business impact. A simple alert informing you that a particular thread pool is above 80 percent utilized is not nearly as useful as a rule that tells you that the standard deviation of response times is growing at an alarming rate because garbage collection is running frequently, CPU utilization is above 90 percent, throughput is down, and requests are awaiting a thread from the thread pool. In the former scenario, you might resize your thread pool, but with the additional analysis provided by the intelligent rule, you know that users are being affected by poorly performing garbage collection behavior, so you might change your heap configuration. Intelligent alerting provides you with an assessment of user impact as well as a clearer diagnostic pathway to discovering the root cause of a problem. The ideal solution provides cross-IT coverage by monitoring all aspects of the application environment and presents this coverage through a unified, customizable dashboard. The dashboard tools should provide proactive discovery of problems before end users experience problems and should be able to kick-start an investigation triage process to identify the root cause. This space has quite a few product offerings, including the following: Quest s Performance Management Suite for Java and Portals: www.quest.com/ performance_management Mercury Diagnostics: www.mercury.com/us/products/diagnostics Symantec I3 for J2EE: www.veritas.com/Products/www?c=product&refId=315 IBM Tivoli: www.ibm.com/tivoli BMC Performance Manager: www.bmc.com/products/products_services_detail/ 0,,0_0_0_302,00.html End-User Experience Monitors Several times in this book I mentioned the importance of understanding your users behavior, because your tuning efforts are valid only for the load that the environment is subjected to. If you properly mimic end-user behavior, then your tuning efforts will be good; if you do not, then you cannot have confidence that your environment will meet your users needs. As such, you need a mechanism to discover what your users are doing, and how often your users are doing those things and in what relative balance. This is referred to as identifying the balanced and representative service requests. There are two approaches to gathering this information: Performing access log analysis Using an end-user experience monitor Access log analysis can show you a breakdown of what requests were executed and in what balance, but access logs do not have any inherent understanding of your business. They work well for a certain subset of Java EE applications, mostly for Web-based applications with explicit URLs. Access logs typically do not capture request parameters or the body of POSTs; therefore, front controller servlets that differentiate requests based off of request parameters as well as applications that submit XML payloads to a single servlet are not good candidates. But if you are using a framework like the Apache Struts Action Framework and differentiating requests by explicit actions (.do extensions), then performing access log analysis can be a good strategy.
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

376 CHAPTER 15 NEXT STEPS Note In

Tuesday, December 11th, 2007

376 CHAPTER 15 NEXT STEPS Note In the interest of full disclosure, at the time of this writing I work for Quest Software. Therefore, I have the greatest exposure to Quest tools, and I use them on a daily basis to solve my customers problems. But because I work in the IT industry, I am aware of the other major vendors in these spaces, and I want to present to you as many options as possible. Performance Analysis Tools Performance analysis tools need to be able to analyze QA, production staging, and production environments and provide the following information: Describe application performance down to the method level Trace requests across JVMs and clustered servers Identify the Java EE perspective of the performance of external dependencies Correlate application server information with application performance information (for example, compare thread pools, connection pools, and JVM heap information with request response information) Integrate with Web servers to trace requests between Web servers and application servers Run under high-load scenarios with low overhead In summary, the performance analysis tool needs to combine bytecode instrumentation with the ability to identify and trace a request across JVMs to reconstruct complete user requests as well as gather application server information through a management interface like JMX. Chapter 4 discussed the underlying nature of these technologies and introduced some of the inherent complexity associated with them. Products in this space include the following: Quest s Application Assurance Suite: www.quest.com/application_assurance Wily Introscope: www.wilytech.com/solutions/products/Introscope.html Mercury Diagnostics for J2EE: www.mercury.com/us/products/diagnostics 24 7 Unattended Monitoring In order to support a production environment, you need a 24 7 unattended monitoring solution that provides a deep level of monitoring across a breadth of technologies and that includes intelligent alerting. Monitoring only your Java EE environment is not sufficient, because problems can occur anywhere within the distributed layered execution model upon which your application runs. For example, if you are running a BEA WebLogic Server that is connecting to an Oracle database, and there is latch contention inside Oracle, then the monitoring solution needs to direct the help desk to triage the problem to the appropriate DBA. Furthermore, the monitoring solution needs to provide alerting rules that go well beyond simple threshold alerting and provide an understanding of the business process. This is referred to as intelligent alerting, or combining performance metrics from disparate sources to derive a
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Web hosting domains - CHAPTER 15 NEXT STEPS With these capabilities,

Tuesday, December 11th, 2007

CHAPTER 15 NEXT STEPS With these capabilities, you can follow the performance unit testing methodologies presented in Chapter 5 to perform use cases, determine exactly what objects your use cases left in memory, and then trace those objects back to the lines of code that allocated them. This procedure enables you to track down Java memory leaks. The other memory problem associated with Java applications is object cycling, or the rapid creation and destruction of temporary objects, which creates an unnecessary burden on the garbage collector and hence reduces application performance. To detect object cycling, you need a memory profiler that monitors garbage collection behavior and can identify and summarize the objects that were garbage collected. It should also provide you with the capability to trace garbage collected items to the line of code that allocated them. The final optional feature is the concept of triggers, which can promote a finer grain of memory debugging. A trigger is an event inside your code that the profiler watches for that causes an action to occur. For example, a trigger might be configured to take a heap snapshot when a particular EJB method is invoked and then take another snapshot when the method completes. You have no way of manually obtaining this level of granularity without writing a test case that invokes only that single method (which may not be possible without establishing the context in which your application invokes it), so triggers can provide fine-grained control over your performance debugging efforts. As you learned in Chapter 5, you should perform performance unit tests against the same unit tests as your functional unit tests, so it is also very important that you have a coverage profiler to tell you exactly what lines of code are and are not being executed by your unit tests. Your coverage profiler establishes your confidence level in your functional and performance unit tests. For example, if you do not detect any cycling objects, memory leaks, or performance bottlenecks, but you are testing only 10 percent of your code, what is your confidence in your analysis? The answer is near zero! But if you verify that you are testing 95 percent of your code and all conditions (for example, both if conditions and else conditions), then your confidence in your analysis is very high. All of these profilers can be run manually, but if you want to embrace a formal testing process, then these tools also need to have an automation interface. In other words, the tools need to provide the following capabilities: execute unit tests during profiling offline (maybe during a weekend build), capture snapshots, and generate reports for you. These automation features not only reduce your testing efforts, but also provide free regression testing, because the tests are running in an automated fashion on a consistent basis, even six months after the code is complete. The commercial offering that basically owns the profiling market is Quest s JProbe Suite. Other products are available and are listed here, but JProbe was the first profiler in the market and has continued to be the leader. JProbe Suite: www.quest.com/jprobe ej-technologies JProfiler: www.ej-technologies.com Borland Optimizeit: www.borland.com/us/products/optimizeit
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Web server type - 374 CHAPTER 15 NEXT STEPS When performing

Monday, December 10th, 2007

374 CHAPTER 15 NEXT STEPS When performing a capacity assessment, you need strict control over the ramp-up behavior as well as the ability to graduate load at a specific pace. For example, if the expected load is 500 users and you have validated that you can support that load, then during your capacity assessment you want to ramp up to 500 users in your normal fashion, but then start increasing load at your predefined graduated step size and rate, such as increasing the load by 20 users every ten minutes. In addition, you need to be able to gather performance analysis information during the load test, so either that capability has to be built into the load tester or you need to have a strong integration between your load tester and performance analysis tool. Even though load testing tools are valuable, they offer little in terms of Java diagnostic detail. Mercury LoadRunner is the most popular commercial tool in the load testing market, and quite a few open source offerings are available as well. You can find a sampling of these products at the following Web sites: Mercury LoadRunner (commercial): www.mercury.com/us/products/performance-center/ loadrunner OpenSTA (free and open source): www.opensta.org Apache JMeter (free and open source): http://jakarta.apache.org/jmeter The Grinder (free and open source): http://sourceforge.net/projects/grinder PushToTest TestMaker (free and open source): www.pushtotest.com This list is by no means exhaustive; it represents the load testers that I have first- or secondhand experience with. I will keep this book s companion Web site up to date, so if I missed your favorite load tester, go to www.javasrc.com and submit it. Performance Profilers When you use a performance profiler in the development phase of your application, the profiler requires three specific components: Code profiler Memory profiler Coverage profiler The code profiler needs to provide line-of-code level profiling, identifying where in your code you are spending all the majority of execution time, in terms of both CPU cycles and elapsed time. Furthermore, it needs to report the number of times each line of code is being executed. As a secondary requirement, it should allow you to track where you are allocating objects and the number of objects being allocated. This information will help you identify and eliminate code-level bottlenecks. The memory profiler needs to provide the following capabilities: Capture heap snapshots Compare heap snapshots Trace heap objects to the line of code that allocated them
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

CHAPTER 15 Next Steps I (Shared web hosting)

Sunday, December 9th, 2007

CHAPTER 15 Next Steps I appreciate you embarking on this journey into the world of performance management with me, and I trust that your efforts will be fruitful. Rather than leave this book as a collection of performance management topics, in this chapter I conclude it with a call to action and help you identify your next steps in taking control of the performance of your applications. To start, I will discuss some of the tools and online resources that can help make your job that much easier. Tools of the Trade Administrators (especially those with a development background) are sometimes reluctant to use third-party tools, as they would rather build what they need on their own. But tools only help you do your job better it is your talent in using them and your domain expertise that makes them effective. If you compare tools to weapons, you might be the finest sharpshooter in the world, but if you have only a slingshot at your disposal, you will not be very effective. On the other hand, if you couldn t shoot the side of a barn from 20 feet, then the best rifle will not help you either. But when you have the skills and the proper tools, you can be hugely effective. This book described quite a few tools that can help you effectively perform your job function. In this section, my aim is to provide you with the criteria that I use when evaluating tools as well as list some vendor links for you to evaluate on your own. Load Tester In this book, we used load testers in two capacities: To simulate end-user behavior To perform capacity assessments To simulate end-user behavior, consider the nature of your requests as well as the robustness of your environment. For example, if your application is strictly Web-based, then you have more options than if you also have thick clients or advanced Web components (such as applets or Flash applications) accessing your server. In the Web scenario, you only need to simulate HTTP GETs and POSTs, something that can be accomplished with many open source tools. But if you have a thick client that makes RMI calls or submits an XML payload to a servlet, you need that type of capability in your load tester. In this case, your choices are to either write a custom load tester or purchase an advanced commercial offering.
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

372 CHAPTER 14 SOLVING COMMON JAVA EE (Web site translator)

Saturday, December 8th, 2007

372 CHAPTER 14 SOLVING COMMON JAVA EE PERFORMANCE PROBLEMS In order to effectively diagnose performance problems, you need to understand how problem symptoms map the root cause of the underlying problem. If you can triage the problem to application code, then you need to forward the problem to the application support delegate, but if the problem is in the environment, then resolving it is within your control. The root of a problem depends on many factors, but some indicators can increase your confidence when diagnosing problems and completely eliminate others. I hope this chapter can serve as a beginning troubleshooting guide for your Java EE environment that you can customize to your environment as issues arise.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

Web host forum - CHAPTER 14 SOLVING COMMON JAVA EE PERFORMANCE

Friday, December 7th, 2007

CHAPTER 14 SOLVING COMMON JAVA EE PERFORMANCE PROBLEMS An application rollback is usually the result of a business rule. Consider a Web application that asks users to take a survey to enter a drawing for a prize. The application may ask the user to enter an age, and a business rule might state that users need to be 18 years of age or older to enter the drawing. If a 16-year-old submits information, the application may throw an exception that redirects the user to a Web page informing that user that he or she is not eligible to enter the drawing. Because the application threw an exception, the transaction in which the application was running rolled back. This rollback is a normal programming practice and should be alarming only if the number of application rollbacks becomes a measurable percentage of the total number of transactions. A nonapplication rollback, on the other hand, is a very bad thing. The three types of nonapplication rollbacks follow: System rollback Time-out rollback Resource rollback A system rollback means that something went very wrong in the application server itself, and the chances of recovery are slim. A time-out rollback indicates that some process within the application server timed out while processing a request; unless your time-outs are set very low, this constitutes a serious problem. A resource rollback means that when the application server was managing its resources internally, it had a problem with one of them. For example, if you configure your application server to test database connections by executing a simple SQL statement, and the database becomes unavailable to the application server, then anything interacting with that resource will receive a resource rollback. Nonapplication rollbacks are always serious issues that require immediate attention, but you do need to be cognizant of the frequency of application rollbacks. Many times people overreact to the wrong types of exceptions, so knowing what each type means to your application is important. Summary While each application and each environment is different, a common set of issues tends to plague most environments. This chapter focused not on application code issues, but on the following environmental issues that can manifest poor performance: Out-of-memory errors Thread pool sizes JDBC connection pool sizes JDBC prepared statement cache sizes Cache sizes Pool sizes Excessive transaction rollbacks
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

370 CHAPTER 14 SOLVING COMMON (Web site builder) JAVA EE

Thursday, December 6th, 2007

370 CHAPTER 14 SOLVING COMMON JAVA EE PERFORMANCE PROBLEMS While the cache is being initialized, its hit ratio will be zero, and its activation count will be high, so you need to observe the cache performance after it is initialized. To work around the initialization phase, you can monitor the passivation count as compared to the total requests for objects in the cache, because passivations will only occur after the cache has been initial ized. But in general, we are mostly concerned with the cache miss ratio. If the miss ratio is greater than 25 percent, then the cache is probably too small. Furthermore, if the miss count is above 75 percent, then either the cache is too small or the object probably should not be cached. Once you determine that your cache is too small, try increasing its size and measure the improvement. If the miss ratio comes down to less than 20 percent, then your cache is well sized, but if increasing the size of the cache does not have much of an effect, then you need to work with the application technical owner to determine whether the object should be cached or whether the application needs to be refactored with respect to that object. Stateless Session Bean and Message-Driven Bean Pools Stateless session beans and message-driven beans implement business processes, and as such do not maintain their states between invocations. When your application needs access to these beans business functionality, it obtains a bean instance from a pool, calls one or more of its methods, and then returns the bean instance to the pool. If your application needs the same bean type later, it obtains another one from the pool, but receiving the same instance is not guaranteed. Pools allow an application to share resources, but they present another potential wait point for your application. If there is not an available bean in the pool, then requests will wait for a bean to be returned to the pool before continuing. These pools are tuned pretty well by default in most applications servers, but I have seen environments where customers have introduced problems by sizing them too small. Stateless bean pools should generally be sized the same as your execution thread pool, because a thread can use only one instance at a time; anything more would be wasteful. Furthermore, some application servers optimize pool sizes to match the thread count, but as a safety precaution, you should configure them this way yourself. Transactions One of the benefits to using enterprise Java is its inherent support for transactions. By adding an annotation to methods in a Java EE 5 EJB, you can control how the method participates in transactions. A transaction can complete in one of the following two ways: It can be committed. It can be rolled back. When a transaction is committed, it has completed successfully, but when it rolls back, something went wrong. Rollbacks come in the following two flavors: Application rollbacks Nonapplication rollbacks
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

Free web hosting services - CHAPTER 14 SOLVING COMMON JAVA EE PERFORMANCE

Wednesday, December 5th, 2007

CHAPTER 14 SOLVING COMMON JAVA EE PERFORMANCE PROBLEMS When a cache is sized too small, the cache management overhead can dramatically impact the performance of the cache. Specifically, when a request queries for an object that is not present in a full cache, then the following steps, illustrated in Figure 14-11, must be performed: 1. The application requests an object. 2. The cache is examined to see if the object is already in the cache. 3. An object is chosen to remove from the cache (typically using a least-recently-used algorithm). 4. The object is removed from the cache (passivated). 5. The new object is loaded from the database into the cache (activated). 6. A reference to the object is returned to the application. Figure 14-11. Because the requested object is not in the cache, an object must be selected for removal from the cache and removed from it, so the new object loaded from the database can be added to the cache before returning a reference back to the application. If these steps must be performed for the majority of requested objects, then using a cache would not be the best idea in the first place! When this process occurs frequently, the cache is said to thrash. Recall that removing an object from the cache is called passivation, and loading an object loaded from persistent storage into the cache is called activation. The percentage of requests that are served by the cache is the hit ratio, and the percentage that are not served is the miss ratio.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.