Archive for September, 2007

Ipower web hosting - CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Nonprecompiled

Sunday, September 30th, 2007

CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Nonprecompiled JSP In an MVC-based Web architecture, the standard process is to implement a controller servlet that handles incoming requests. The front-controller servlet (Controller) interacts with business functions that build resultant beans (Model) containing the results of the request, and those results are forwarded to a JSP for presentation (View). In this type of environment, if the JSP is not currently compiled, when the RequestDispatcher s forward()method is called, the application server must go through a three-step process before executing the JSP functionality: 1. It must convert the JSP to servlet source code; it builds a .java source code file. 2. It must compile the servlet into bytecode; it builds a .class file. 3. It loads the .classfile into permanent memory and creates an instance in the heap to handle the request. When this process occurs, from a bytecode instrumentation perspective, the RequestDispatcher.forward() method takes extra time to process. If the JSP is already compiled, then this method should have close to zero exclusive time, but if not, then this method can contribute greatly to the overall response time of the request. SQL Report The most accurate assessment of database performance health is best performed by database monitoring software, but you can learn a lot about how database queries affect the performance of Java EE applications. By using bytecode instrumentation, you can learn the following, for example: The number of unique SQL statements executed by an application A list of all SQL executed by an application The number of times each SQL statement was executed The average response time for each SQL statement The maximum response time for each SQL statement The total response time for each SQL statement A breakdown of the time spent in preparation, execution, and retrieval for each SQL statement The service requests that were affected by each SQL statement The SQL report serves these purposes: Identifies problematic SQL to send to DBAs for troubleshooting Determines the number of unique SQL statements executed to best size the prepared statement cache Maps SQL statements to the requests that execute them
We recommend high quality webhost to host and run your jsp application: christian web host services.

294 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT (Web design portfolio)

Saturday, September 29th, 2007

294 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT A slow method. If the problem is not the result of an external call or the sheer number of calls to a method, then the ultimate issue may simply be the method itself. When this occurs, the answer is to take the code off-line and analyze it in a code profiler to determine why it is slow. An environmental issue, such as a saturated thread pool or a major garbage collection. Diagnosing Implicit Problems When diagnosing application issues, you may inadvertently discover environmental problems. The manifestations of these problems may be initially confusing because slow response times at these points should not be possible, but once you understand that they are wait points, it all becomes clear. The sections that follow detail common interpretations of implicit problems discovered through application call tree analysis. Thread Pool Pending Request During the course of request analysis, you may see a request waiting at the application server s embedded Web server. This is characterized by a significant amount of time being spent in the GET /webapp/myaction.do node (or whatever the URL happens to be), which is the node that executes just prior to the servlet s process(), doGet(), or doPost() method. In theory this is impossible, because the after the Web server receives a request, it should immediately invoke the appropriate servlet, but it makes sense as soon as you realize that the request handling process places the request in a queue and it is subsequently picked up by an execute thread for processing. Any exclusive time spent in this node identifies the amount of time a request is spending in a request queue waiting for an execution thread. On a related note, if you separate your environment into a distinct static Web tier and a dynamic Web tier by placing a Web server such as Apache or Microsoft IIS in front of your application, you can learn how much time the request spends in the Web server before being passed to the application server by looking at that node. Different monitoring tools have different solutions for they type of integration, but the tool I use, PerformaSure, has a specific Web server plug-in that records that time. Typically this pass-through is quick, so a large exclusive time in this node may be an indication that the Web server thread pool is backing up. JDBC Connection Pool Although you have explicit JDBC connection pool monitoring and rules to determine when all of the connections in a connection pool are in use, you can identify the same problem implicitly and learn about the requests being affected by looking at bytecode instrumentation. During the course of your application processing a request, if your application needs a database connection, it obtains that connection from the connection pool when your code calls DataSource.getConnection(). The getConnection() method is available through bytecode instrumentation, and if a connection is available in the connection pool, then it should be returned almost instantaneously. But if the request spends any significant amount of time in the getConnection() method, the connection pool does not have any available connections and is forced to wait for an available connection.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT In (Web hosting services)

Friday, September 28th, 2007

CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT In the end, you will have identified a collection of offending methods, and it is your responsibility to identify why they are slow. One of the most common causes of a slow method is a call to an external dependency, such as a database. Figure 10-15 reveals that there was a SQL statement in this example that took almost 1 second to complete. Figure 10-15. The highlighted SQL statement took almost 1 second to complete. As shown in Figure 10-15, the highlighted SQL statement spent on average 0.990 seconds executing, but it is worth noting that its maximum response time was 8.597 seconds, meaning that when the request s response time executed slowly, the database contributed significantly to the overall response time. (Note that I extracted this example from a real customer application, so I excluded the customer s SQL for privacy reasons.) Performance problems inside applications tend to have one of the following causes: A slow call to an external dependency. A method (or subgraph of a request) called an excessive number of times. The method may perform adequately each time it is called, but it is called so many times that it becomes problematic. This issue is common when building large strings; internally, string concatenations resolve to StringBuffer.append() method calls. The append() method usually completes in less than one millisecond, but when it is called 10,000 times, it becomes problematic!
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Web hosting colocation - 292 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT

Thursday, September 27th, 2007

292 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Figure 10-13. The call tree color codes its nodes by the average exclusive time of each method. Figure 10-14. After moving past the Struts code that is not part of the application, the next slowest point in the request was a call to calculateOrderTax().
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT (Web host forum) Figure

Wednesday, September 26th, 2007

CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Figure 10-12. The call tree color codes its nodes by the average cumulative time of each method. As Figure 10-12 illustrates, the Web server receives the request, forwards it to the Apache Struts doGet() method, which in turn calls the RequestProcessor.process() method. The popup window demonstrates that the doGet() method was a component of the hot path (because its average cumulative time was 27.276 seconds), but it is not a hot point (because its average exclusive time was less than 0.001 second). Figure 10-13 shows a view of the same request tree sorted by the average exclusive time. Figure 10-13 sorts the color coding by exclusive time, revealing that the RequestProcessor. process() method spent 13.5 exclusive processing seconds of a total of 27.7 cumulative seconds. Further investigations will reveal that this is the largest hot point within the request, but another 14.2 seconds need to be accounted for. Note This is a complicated request, and the 27.7 seconds of total response time are broken into various components. The 13.5 exclusive seconds spent inside the RequestProcessor.process() method are actually a little misleading, because the org.apache.struts.action package is grouped in a custom component, so the process() method may not have taken 13.5 seconds, but 13.5 seconds elapsed inside the org.apache.struts.action package before calling out to application code. We continue this process by identifying the next slowest node in the hot path, isolating its subtree, and finding its hot point. In this example, the next slowest method, calculateOrderTax(), accounted for almost 3 of the remaining 14.2 seconds, as shown in Figure 10-14.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

Hosting web - 290 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT

Tuesday, September 25th, 2007

290 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Figure 10-11. Requests sorted by their total response times Once you have identified service requests that require deeper diagnostics, the next step is to view their call traces, or open them in a call tree view. From these call trees you want to determine the following: What is the hot path through a request? What is the hot point within that hot path? The hot path reveals the slow path through the code: what path did the request follow from initially receiving the request to its slowest method? The hot point identifies the slowest method in the request. In order to identify the hot path and hot point, you need to sort the method response time data by different values: Average cumulative time: This is the amount of time spent inside of a method in addition to all methods that it called out to. Sorting by average cumulative time reveals the hot path through a request. Average exclusive time: This is the amount of time spent only in a method (and does not include any time spent in methods that it called out to). Sorting by average exclusive time reveals the hot point in a request. Figure 10-12 shows a view of a request tree sorted by the average cumulative time.
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Figure (Web hosting reviews)

Thursday, September 20th, 2007

CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Figure 10-10 displays the same requests, but sorted by maximum response time. While the third request completed with an acceptable average response time (1.657 seconds), its maximum response time was almost 47 seconds. When things went bad, they went very bad! Figure 10-10. Requests sorted by their maximum response times Figure 10-11 displays the same requests, but sorted by total response time. While the fourth request completes with an acceptable average response time (0.878 seconds), it is executed 1,248 times, yielding a total response time of 1,095 seconds. Each of the aforementioned requests deserves attention and deeper diagnostics. You cannot simply look at requests that perform slowly on average; you must also include those with periodic spikes and those that significantly impact the performance of the application because of their call counts. The difference in diagnostics is that tuning average slow-running requests is a reactive process, while tuning requests with heavy impact is a proactive process to improving application quality. But as you can observe from Figures 10-9 through 10-11, there is a great deal of overlap: requests that average slow response times usually have spikes and are often called frequently.
If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.

288 CHAPTER 10 (Dedicated web hosting) JAVA EE PERFORMANCE ASSESSMENT

Wednesday, September 19th, 2007

288 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Average response time: The average response time for the request during the aggregated sample Maximum response time: The maximum response time for the request during the aggregated sample Call count: The number of times the request was executed during the aggregated sample Total response time: The total time that this request spent executing during the sample (average response time multiplied by the call count) Exceptional exits: For each request during the aggregated sample, how many times it ended in an exception Percent incomplete: For each request during the aggregated sample, how many times it failed to complete within the configured time-out value Identifying service requests that average slow response times involves sorting all requests by their average response time. Figure 10-9 displays this information for a session sorted by average response times, revealing three service requests that took longer than five seconds on average during the recording. Figure 10-9. Requests sorted by their average response times
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

CHAPTER 10 JAVA EE PERFORMANCE (Web site hosting) ASSESSMENT

Tuesday, September 18th, 2007

CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT SUPPORTS: If this method is invoked inside a transaction context, then it will participate, but it is not required to run inside a transaction context. NOT_SUPPORTED: This method does not participate in transactions, so if it is invoked by a method currently running inside a transaction, that transaction is suspended while this method runs. NEVER: This method will never run inside a transaction. Furthermore, if you call it from a method currently running in a transaction, then this method will throw an exception. When transactions occur, either they can be committed or they can fail and roll back. From an analysis perspective, we look at commit rates, rollback rates, and the nature of rollbacks. Rollbacks can come in one of several forms, defined as follows: Application rollbacks: An application transaction has failed; this can be a normal function of the application. For example, an application that processes a survey may roll back a transaction if the user submitting the transaction is under 18 years old. System rollbacks: Something very bad happened in the application server, such as a hardware failure that causes the application server to stop responding. Resource rollbacks: A resource somehow failed for example, the application server attempts to renew a database connection and cannot connect to the database. Time-out rollbacks: A request took too long to process, so the application server killed it and threw a time-out exception. In a performance analysis report, these metrics are interpreted as follows: If the percentage of transactions rolled back is greater than 10 percent, then issue a critical alert. If a nonapplication rollback occurs, issue a fatal alert. Application Analyzing the performance of an application involves identifying slow service requests and then triaging and isolating their root causes, which we look at in the sections that follow. Identifying Slow Service Requests The first step is to identify slow-running service requests, which come in three flavors: Service requests that average slow response times Service requests that average acceptable response times, but experience periodic spikes in response time Service requests that average acceptable response times, but significantly impact the system due to the sheer number of times they are called Your monitoring tool should provide the following information for each aggregated sample for each request that it observes during a test:
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

286 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT (Free web design)

Monday, September 17th, 2007

286 CHAPTER 10 JAVA EE PERFORMANCE ASSESSMENT Built-in message servers that ship with application servers usually only allow you to tune the capacity of the message server. If you are using such a server, you need to ensure that messages are not being rejected, so observe the following values: If the message server averages over 80 percent of its capacity, then you should issue a critical alert that its capacity needs to be increased. If the message server averages over 95 percent and messages are being rejected, then you should issue a fatal alert that its capacity needs to be increased. Another consideration to evaluate is the amount of time it takes for a message to be delivered to its destination; this can be impacted by the reliability that is being assigned to the message. Reliability is a measure of how certain you need to be that your message is delivered to its recipient(s). If it is of the utmost importance that the message be delivered, then reliability is high, requiring the delivery to be acknowledged by the recipient. If the message delivery does not have to be guaranteed, such as a message containing a status update in which several messages will be sent every few seconds, then reliability is low because losing a message is not necessarily that important. Decreasing the level of reliability can help messages move through the message server faster. Finally, if you are using an advanced message server, such as IBM MQSeries or the TIBCO suite of products, as an integration tool between your application and another infrastructure, then you have entirely another beast to tune. Due to the discrepancy between message server implementations, I suggest you reference the manufacturer s tuning guide for more information. But keep in mind that the tuning goal is to move messages as quickly as possible between your application and mainframe and still satisfy reliability requirements. Transactions Java EE provides the Java Transaction API (JTA) and Java Transaction Server (JTS), which allow you to run code inside the context of a transaction. Code that runs inside a transaction behaves as follows: if the transaction succeeds, then its changes are committed to the state of objects as well as transaction-aware resources such as databases, but if the transaction fails, then the system is returned to its state before the transaction started. This property of transactions is referred to as atomicity, meaning that the transaction behaves as a single atomic unit: either it all works or the system returns to its state before the transaction started. Java EE provides explicit control over transactions or container-managed control over transactions. In Java EE 5 applications, EJB business methods can elect to participate in transactions by simply adding annotations to method headers (refer to the EJB3 specification, section 12.3.7 for additional information). The level of transaction participation can be one of the following values, specified through the TransactionAttribute annotation as one of the following TransactionAttributeTypes: MANDATORY: The method must be invoked inside a client s transaction context. REQUIRED: The method must be invoked inside a valid transaction context. If a transaction context does not currently exist, then a new one is created. REQUIRES_NEW: The method must be invoked inside a new transaction context. This method will act as its own atomic unit.
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.