<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xebia Blog &#187; Performance</title>
	<atom:link href="http://blog.xebia.com/tag/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xebia.com</link>
	<description>Software development done right!</description>
	<lastBuildDate>Wed, 01 Feb 2012 00:30:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Web performance in seven steps; Step 6: Tune based on evidence</title>
		<link>http://blog.xebia.com/2009/11/02/web-performance-in-seven-steps-step-6-tune-based-on-evidence/</link>
		<comments>http://blog.xebia.com/2009/11/02/web-performance-in-seven-steps-step-6-tune-based-on-evidence/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 21:20:11 +0000</pubDate>
		<dc:creator>Jeroen Borgers</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[tuning]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=3376</guid>
		<description><![CDATA[Last time I blogged about the relevance of monitoring and diagnostics in production to solve incidents quickly and prevent future problems. This time I&#8217;ll talk about tuning based on evidence. If an application turns out to be too slow, tuning can provide a solution. Tuning can take place on multiple levels. Adding hardware can be [...]]]></description>
			<content:encoded><![CDATA[<p>Last time I blogged about the relevance of <a href="http://blog.xebia.com/2009/08/31/web-performance-in-seven-steps-step-5-monitor-and-diagnose/">monitoring and diagnostics in production</a> to solve incidents quickly and prevent future problems. This time I&#8217;ll talk about tuning based on evidence. </p>
<p>If an application turns out to be too slow, tuning can provide a solution. Tuning can take place on multiple levels. Adding hardware can be a cheap solution. However, when you add hardware at a place where the bottleneck is not located, this has little use.<br />
<span id="more-3376"></span><br />
Important steps of tuning are therefore identifying which pages or services do not meet stated requirements and isolating the problem: where is it located, in which layer, in which component. This can be made clear with testing and monitoring on application parts. The next step is diagnosing. In fact, this comes down to making up a hypothesis why this component is so slow.</p>
<p><img src="http://blog.xebia.com/wp-content/uploads/2009/11/tuning-cycle.jpg" alt="Performance tune cycle" title="tuning-cycle" width="375" height="227" class="size-medium wp-image-3379" /><br />
Figure 1. Performance tune cycle.</p>
<p>This can for instance be a missing or wrong index on a database table or the invocation of too many small queries. Next, the component is improved based on this hypothesis. Finally, one needs to verify whether the improvement actually brings the expected speedup. If so, then the proposed hypothesis is true and the speedup is the result. If not, then there is something wrong with the hypothesis and we need an alternative hypothesis. As soon as the performance of the system meets its requirements, tuning is finished. </p>
<p><img src="http://blog.xebia.com/wp-content/uploads/2009/11/evidence-300x244.jpg" alt="finding evidence" title="evidence" width="300" height="244" class="size-medium wp-image-3384" /><br />
Figure 2. Finding evidence.</p>
<p>The right tools are indispensable: performance test tool, enterprise profiler, heap monitor, etc. I have seen developers work on assumed performance improvements which turned out not to help at all, or even slowed down the application and also deteriorate the maintainability and flexibility. This is caused by the fact that developers are used to mould functionality from source code and therefore work from source code to improve performance. What is missing here is measure, don&#8217;t guess. This is something developers learn in my performance training. Experience also has taught me to judge every proposed improvement separately and to only implement the improvement when we have proven that it really helps. Without this systematic approach, a handful of steps together may take you backwards at the end of the day instead of forwards.</p>
<p>Next time I&#8217;ll talk about <a href="http://blog.xebia.com/2009/11/18/web-performance-in-seven-steps-step-7-share-the-responsibility-for-the-whole-chain/">Sharing responsibility for the whole chain</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/11/02/web-performance-in-seven-steps-step-6-tune-based-on-evidence/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F11%2F02%2Fweb-performance-in-seven-steps-step-6-tune-based-on-evidence%2F&amp;title=Web%20performance%20in%20seven%20steps%3B%20Step%206%3A%20Tune%20based%20on%20evidence" id="wpa2a_2"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/11/02/web-performance-in-seven-steps-step-6-tune-based-on-evidence/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web performance in seven steps; Step 5: Monitor and diagnose</title>
		<link>http://blog.xebia.com/2009/08/31/web-performance-in-seven-steps-step-5-monitor-and-diagnose/</link>
		<comments>http://blog.xebia.com/2009/08/31/web-performance-in-seven-steps-step-5-monitor-and-diagnose/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 22:38:36 +0000</pubDate>
		<dc:creator>Jeroen Borgers</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/blog.xebia.com/www/wp-content/plugins/autometa/autometa.php</b> on line <b>303</b><br />
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[JAMon]]></category>
		<category><![CDATA[JARep]]></category>
		<category><![CDATA[Opensource]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=3076</guid>
		<description><![CDATA[Last time I blogged about the importance of continuous performance testing. When you write and run performance tests continuously, just like unit tests, you get early performance insights in new and changed features of your software. This will minimize surprises and be more productive. Now I’ll blog about monitoring and diagnostics. When a new version [...]]]></description>
			<content:encoded><![CDATA[<p>Last time I blogged about the importance of <a href="http://blog.xebia.com/2009/07/22/web-performance-in-seven-steps-step-4-test-continuously/">continuous performance testing</a>. When you write and run performance tests continuously, just like unit tests, you get early performance insights in new and changed features of your software. This will minimize surprises and be more productive. Now I’ll blog about monitoring and diagnostics.</p>
<p>When a new version of the software is released into the production environment, the question always is: will it actually perform like we saw in testing and acceptance environments? And we keep our fingers crossed.<br />
<span id="more-3076"></span>It is therefore important in such cases to monitor carefully what happens with the performance and availability of the application. </p>
<p>There are all sorts of tools and services available to monitor your web site for availability and response times of web pages, like <a href="http://www.uptrends.com">Uptrends</a>, <a href="http://site24x7.com">Site24x7</a> and <a href="http://www.dotcom-monitor.com/">Dotcom-monitor</a>. They look at the application as a black box and measure once in several minutes. This is very useful, however, to be able to take the right measures in case of a calamity, it is necessary to be able to pin-point the problem. It is therefore essential to monitor on multiple levels and on multiple internal application parts. For levels, think of hardware, OS, app server, web server, database and application. Measuring internal Java application parts can be achieved with <a href="http://jamonapi.sourceforge.net/">JAMon</a>. JAMon is an open source timing API and basically works like a stopwatch with a start() and stop() call. Every method which you want to measure gets its own stopwatch (or counter) . We deal with JAMon as one of the tools to measure time in the first day of our <a href="http://www.xebia.com/events/speeding-java-applications-0">Speeding up Java Applications course</a>.</p>
<p><img src="http://blog.xebia.com/wp-content/uploads/2009/08/interceptor.jpg" alt="JAMon API start() and stop() calls in a Spring interceptor" title="JAMon API start() and stop() calls in a Spring interceptor" width="490" height="232" class="alignright size-full wp-image-3079" /><br />
Figure: JAMon API start() and stop() calls in a Spring interceptor</p>
<p>Each counter maintains statistics like the number of calls, average, maximum, standard deviation, etc. , and this information can be requested for. The individual calls are not stored. This approach results in low memory usage and a low performance overhead, at the cost of some information loss. Recently, a new competitor of JAMon appeared: <a href="http://code.google.com/p/javasimon/">Simon</a>. It claims to be JAMon’s successor, although it has (had) some <a href="http://day-to-day-stuff.blogspot.com/2008/12/evaluating-simon.html">infancy issues</a>. </p>
<p>Then there is the question: where to measure? The answer is that it makes most sense to measure all incoming calls like web requests and outgoing calls to for instance the database. Furthermore, parts like Spring beans, EJB’s and DAO’s. Measuring these parts is not only relevant with new releases, but also trends and usage spikes are useful to monitor in order to solve quickly and prevent various problems. Open source tool <a href="http://sourceforge.net/projects/jarep/">JARep</a> offers the possibility to store JAMon data from a cluster in a database and monitor trends and changes graphically. </p>
<p><img src="http://blog.xebia.com/wp-content/uploads/2009/08/jarep-non-ag-nohits-vo1.jpg" alt="JARep shows the increasing response time trend starting October 15, on two of the four production JVMs." title="JARep shows the increasing response time trend starting October 15, on two of the four production JVMs." width="620" height="571" class="alignleft size-full wp-image-3092" /><br />
Figure: JARep shows the increasing response time trend starting October 15, on two of the four production JVMs.</p>
<p><strong>Customer story</strong></p>
<p>We had the following situation at our customer. Processing an order slowly took more and more time over a period of several weeks. This happened while no new release was introduced and no other page became slower. This behavior was a complete mystery, until we looked deeper in our JARep monitoring tool. The troublemaker turned out to be a DAO executing a prepared statement with only part of the variables being bind-variables. With help of JARep, we could look back to where the trend of increasing response time started so when the problems started. We could also see that this problem was only present at one of the two machines. With this knowledge and his log book, the operator could remember that on the start date he had experimented with a new JDBC driver to try to solve a memory leak. This seemed not to change anything concerning performance, what actually was the case in the beginning. Problems only appeared slowly during the following weeks. They had left the new driver in place, manifesting itself as a time bomb later. When we put back the old driver, the problem disappeared. This real life experience shows the usefulness of monitoring and trend analyses on application internals.</p>
<p>Next time I&#8217;ll blog about <a href="http://blog.xebia.com/2009/11/02/web-performance-in-seven-steps-step-6-tune-based-on-evidence/">evidence based tuning</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/08/31/web-performance-in-seven-steps-step-5-monitor-and-diagnose/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F08%2F31%2Fweb-performance-in-seven-steps-step-5-monitor-and-diagnose%2F&amp;title=Web%20performance%20in%20seven%20steps%3B%20Step%205%3A%20Monitor%20and%20diagnose" id="wpa2a_4"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/08/31/web-performance-in-seven-steps-step-5-monitor-and-diagnose/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Web performance in seven steps; Step 4: Test continuously</title>
		<link>http://blog.xebia.com/2009/07/22/web-performance-in-seven-steps-step-4-test-continuously/</link>
		<comments>http://blog.xebia.com/2009/07/22/web-performance-in-seven-steps-step-4-test-continuously/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 20:25:17 +0000</pubDate>
		<dc:creator>Jeroen Borgers</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/blog.xebia.com/www/wp-content/plugins/autometa/autometa.php</b> on line <b>303</b><br />
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Quality Assurance]]></category>
		<category><![CDATA[Testing]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=2694</guid>
		<description><![CDATA[Last time I blogged about the importance of representative performance testing. Having production-like properties for hardware, OS, JVM, app server, database, external systems and simulated user load are essential to prevent bad performance surprises when going live. In addition, I described how cloud computing can be utilized to generate high loads on-demand without having to [...]]]></description>
			<content:encoded><![CDATA[<p>Last time I blogged about the importance of <a href="http://blog.xebia.com/2009/06/29/web-performance-in-seven-steps-step-3-test-representatively/">representative performance testing</a>. Having production-like properties for hardware, OS, JVM, app server, database, external systems and simulated user load are essential to prevent bad performance surprises when going live. In addition, I described how cloud computing can be utilized to generate high loads on-demand without having to worry about the infrastructure.</p>
<p><strong>Continuous performance testing</strong><br />
With a representative test as one of the last steps before going live we prevent that expensive bad-performance surprises will pop up in production. However, the same surprises will pop-up, only earlier and with less impact. To save costs and prevent large architectural refactoring, it is crucial to test for performance as soon as possible. This is just like any other software defects and Quality Assurance: the later in the development process defects are detected, the more costly these defects are. </p>
<p>At a popular web shop I had the following challenge: <span id="more-2694"></span>we wrote the performance tests only at the end of the six-weekly release period, after functional testing had taken place and functional defects were corrected. In case serious performance defects popped up, a crisis team was gathered and we found ourselves in a stressful situation. There was usually not enough time to fix the defect before the release date, so my recommendation at times was to defer the release date. However, deferring the release date often just was not possible, because TV or radio time was bought to promote the new functionality. So, how to solve this dilemma? We found the solution in applying agile principles: test features as early as possible and the team is responsible. </p>
<p>We included meeting performance requirements in the definition of done in each new or changed feature individually. The development process already included an automatic build, quite common these days. Unit tests of a feature were written as usual by the developer. We now introduced performance tests to the spectrum: the developer writes the performance test script for his feature (service or web page) in JMeter, side-by-side to his unit tests on the classes. When the nightly build with Maven has taken place, the application is deployed on WebSphere and the performance tests are run by the JMeter Ant script. This script generates a report which is e-mailed to stakeholders. In this way, the IT department gets early insight into new and changed features, it can adapt its course more quickly, back-off early from an unfortunate architecture or approach, minimize surprises and have lower costs as well. Additional benefit is that writing test scripts gets done more quickly than before, because the developer has all details of the new feature still fresh in his memory. These details are for instance the conditions under which the service may be called and by which parameters, in which variations and special cases.  The usual communication overhead between a performance tester and a developer on these details is drastically reduced, thereby further improving productivity. </p>
<p>Continuous performance testing is too often underestimated and un recognized in my opinion, it really has a whole lot of advantages and it is not that hard to achieve.</p>
<p>Next time I’ll blog about <a href="http://blog.xebia.com/2009/08/31/web-performance-in-seven-steps-step-5-monitor-and-diagnose/">Step 5: Monitoring and diagnostics</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/07/22/web-performance-in-seven-steps-step-4-test-continuously/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F07%2F22%2Fweb-performance-in-seven-steps-step-4-test-continuously%2F&amp;title=Web%20performance%20in%20seven%20steps%3B%20Step%204%3A%20Test%20continuously" id="wpa2a_6"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/07/22/web-performance-in-seven-steps-step-4-test-continuously/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web performance in seven steps; step 3: test representatively</title>
		<link>http://blog.xebia.com/2009/06/29/web-performance-in-seven-steps-step-3-test-representatively/</link>
		<comments>http://blog.xebia.com/2009/06/29/web-performance-in-seven-steps-step-3-test-representatively/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 20:34:44 +0000</pubDate>
		<dc:creator>Jeroen Borgers</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Quality Assurance]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[JMeter]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=2269</guid>
		<description><![CDATA[Last time I blogged about the importance of benchmarking the architecture and new technology in a Proof of Concept for Performance. This time I’ll deal with the importance of representative performance testing. Slowness of applications in development environments is often neglected with the rationale that faster hardware in the production environment will solve this problem. [...]]]></description>
			<content:encoded><![CDATA[<p>Last time I <a href="http://blog.xebia.com/2009/06/15/web-performance-in-seven-steps-step-2-execute-a-proof-of-concept/">blogged </a>about the importance of benchmarking the architecture and new technology in a Proof of Concept for Performance. This time I’ll deal with the importance of representative performance testing. </p>
<p>Slowness of applications in development environments is often neglected with the rationale that faster hardware in the production environment will solve this problem. However, whether this is really true can only be predicted with a test on a representative environment and in a representative way. In such an environment, there needs to be more representative than just the hardware.<br />
<span id="more-2269"></span><br />
I have experienced multiple times that a database query on the test database with 1000 customers took only less than 10 ms., while on the production database with 100.000 customers this turned out to take tens of seconds, because of missing indexes. So, if the development team does not test with a full, complete database, going to production may lead to some surprises. </p>
<p>It is also important that the number of concurrent users and their behavior is well simulated in the test. Furthermore, care should be taken to take caching effects into account: if the test continuously requests for the same product by the same customer, this data will be in database or query cache the second and following times. This will speed up the request considerably and be much faster than with many customers and products. This test is therefore not representative for the real situation. </p>
<p>A suitable performance test tool and performance expertise is necessary to create a valuable test. The most popular open source performance test tool is Apache JMeter, see the next figure.</p>
<p><img src="http://blog.xebia.com/wp-content/uploads/2009/06/web-shop-case-study-jmeter.jpg" alt="Run of a performance test in JMeter." title="web-shop-case-study-jmeter" width="600" height="356" class="size-full wp-image-2268" /><br />
Figure: Screenshot of a run of a performance test in Apache JMeter.</p>
<p>We deal with this tool, and how to performance test properly in our <a href="http://www.xebia.com/events/speeding-java-applications-0">Speeding up Java Applications course</a>. This is a tool made by programmers, for programmers. Test scripts can be created with visual elements like a HTTP request, which can be recorded and configured. Many are available and if you need more, you can always fall back on a BeanShell element in which you can manipulate the request, response and various JMeter variables. If that even does not meet your needs yet, you can extend JMeter source code and develop your own elements. Because of its for-programmers nature, it is less suited for the average tester. Also reporting features and maintainability of the scripts are both not so great. Therefore, commercial tools like HP Mercury LoadRunner, Borland SilkPerformer or Neotys’ Neoload may be good alternatives for companies. </p>
<p><strong>Performance testing from the cloud</strong></p>
<p>The emergence of cloud computing adds new possibilities for performance testing. An elastic compute cloud like Amazon EC2 provides the ability to scale up quickly with the number of application deployments because of increasing load. For performance testing, the cloud can be used the other way around: for temporary use of many load generating test clients to generate expected and peak loads for your application. This saves you from having to buy many servers to run the load generating clients and if you run these performance tests say only a couple of days in a release cycle, this can be an economically attractive solution. Quite some information is available how to test with various <a href="http://www.performanceengineer.com/blog/performance-testing-from-the-cloud/">performance tools from the cloud</a>.</p>
<p>Next time I’ll blog about <a href="http://blog.xebia.com/2009/07/22/web-performance-in-seven-steps-step-4-test-continuously/">step 4: continuous performance testing</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/06/29/web-performance-in-seven-steps-step-3-test-representatively/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F06%2F29%2Fweb-performance-in-seven-steps-step-3-test-representatively%2F&amp;title=Web%20performance%20in%20seven%20steps%3B%20step%203%3A%20test%20representatively" id="wpa2a_8"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/06/29/web-performance-in-seven-steps-step-3-test-representatively/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web performance in seven steps; step 2: Execute a proof of concept</title>
		<link>http://blog.xebia.com/2009/06/15/web-performance-in-seven-steps-step-2-execute-a-proof-of-concept/</link>
		<comments>http://blog.xebia.com/2009/06/15/web-performance-in-seven-steps-step-2-execute-a-proof-of-concept/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 19:40:14 +0000</pubDate>
		<dc:creator>Jeroen Borgers</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/blog.xebia.com/www/wp-content/plugins/autometa/autometa.php</b> on line <b>303</b><br />
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Quality Assurance]]></category>
		<category><![CDATA[Requirements Management]]></category>
		<category><![CDATA[Testing]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=2036</guid>
		<description><![CDATA[Last week I blogged about setting your performance goals: defining your requirements. This time I&#8217;ll blog about the importance of a Proof of Concept for performance. The IT world is very sensitive to trends. Having been around in the IT industry for 15 years, I’ve seen a few. A technology is hot for a while, [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I <a href="http://blog.xebia.com/2009/06/10/web-performance-in-seven-steps-step-1-define-performance-requirements/">blogged</a> about setting your performance goals: defining your requirements. This time I&#8217;ll blog about the importance of a Proof of Concept for performance.</p>
<p>The IT world is very sensitive to trends. Having been around in the IT industry for 15 years, I’ve seen a few. A technology is hot for a while, and then quickly becomes out-of-fashion and yesterdays news. It will be replaced by something which is <em>much </em>better and what everyone follows almost blindly.<br />
<span id="more-2036"></span><br />
Such fashion items are for example CORBA, CGI, applets, EJB, Struts, Spring, Server Faces, XML, SOA, OMT, UML and RIA to name a few. Often new, <em>bleeding edge</em> technology is used in a project just for the sake of being trendy. In addition, each technology or framework comes with its own teething troubles and largely uses more resources than its predecessor. Goal of such a new technology is generally improvement of flexibility, productivity or maintainability, and performance usually has no priority or has not even been considered at all. </p>
<p>Therefore, it is questionable if the chosen new technology and architecture will meet the specified performance requirements. In practice, this regularly becomes only evident in a late stage of the project: when it has already slipped beyond the planned production date. Only then it may become clear that the chosen technology or architecture is just not sufficient. And switching to a different technology or architecture usually results in high cost and long delays. Therefore it is essential to execute a Proof of Concept for performance in which all technology and architecture components are touched, in a vertical slice of the application. It is important that this test is performed in a sufficiently representative manner, on which I will elaborate in my next post. By executing this PoC and understanding and using the results of it, the project can early be corrected in the right direction to prevent excessive cost and delay.</p>
<p>Next time I&#8217;ll blog about <a href="http://blog.xebia.com/2009/06/29/web-performance-in-seven-steps-step-3-test-representatively/">step 3: representative performance testing</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/06/15/web-performance-in-seven-steps-step-2-execute-a-proof-of-concept/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F06%2F15%2Fweb-performance-in-seven-steps-step-2-execute-a-proof-of-concept%2F&amp;title=Web%20performance%20in%20seven%20steps%3B%20step%202%3A%20Execute%20a%20proof%20of%20concept" id="wpa2a_10"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/06/15/web-performance-in-seven-steps-step-2-execute-a-proof-of-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web performance in seven steps; step 1: define performance requirements</title>
		<link>http://blog.xebia.com/2009/06/10/web-performance-in-seven-steps-step-1-define-performance-requirements/</link>
		<comments>http://blog.xebia.com/2009/06/10/web-performance-in-seven-steps-step-1-define-performance-requirements/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:33:27 +0000</pubDate>
		<dc:creator>Jeroen Borgers</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/blog.xebia.com/www/wp-content/plugins/autometa/autometa.php</b> on line <b>303</b><br />
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Requirements Management]]></category>
		<category><![CDATA[requirements]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=1990</guid>
		<description><![CDATA[Last week I blogged about how performance problems manifest themselves: frustration, loss of revenue and disruption of development; and how adding hardware is a questionable solution. This week I&#8217;ll blog about the first step to assure web performance. It can be a valid choice to run the risk of performance problems in production and deal [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I <a href="http://blog.xebia.com/2009/06/02/web-performance-in-seven-steps-how-performance-problems-manifest-themselves/">blogged</a> about how performance problems manifest themselves: frustration, loss of revenue and disruption of development; and how adding hardware is a questionable solution. This week I&#8217;ll blog about the first step to assure web performance.</p>
<p>It can be a valid choice to run the risk of performance problems in production and deal with them in a re-active manner. However, it is usually wiser to be pro-active and prevent them. This approach brings more certainty, peace of mind and also saves money. It consists of seven steps. Step 1: Define performance requirements.<br />
<span id="more-1990"></span></p>
<p>Defining the performance requirements well usually is of under-estimated importance. Most of the time the requirement is formulated as: <em>it just has to be fast</em> or: <em>at least as fast as the previous platform</em>. With such vague definitions the confusion starts. The goal is unclear and is typically explained very differently by the business and the IT department. To prevent this, the goals should be formulated in a SMART way and be prioritized. Speed will be more important for a shop homepage than for a page where a customer can change his profile. By defining priorities, this order of importance is made explicit and clear. From SMART, the A stands for Attainable and the R for Realistic. These aspects are often ignored by the non-technical contributors to these requirements. In that case, a short response time will lead to an extended development time or expensive hardware. Half a second slower during peak hours can be acceptable if this saves tons of money. On the other hand, reducing the response time of an important page from 4 to 2 seconds can lead to a substantial growth in revenue. So, a solid analysis of the impact of performance on the business is needed to be able to clearly define the performance requirements in a SMART way, prioritized and be able to balance the cost and benefits.</p>
<p>Next time we’ll deal with <a href="http://blog.xebia.com/2009/06/15/web-performance-in-seven-steps-step-2-execute-a-proof-of-concept/">step 2: Execute a performance PoC</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/06/10/web-performance-in-seven-steps-step-1-define-performance-requirements/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F06%2F10%2Fweb-performance-in-seven-steps-step-1-define-performance-requirements%2F&amp;title=Web%20performance%20in%20seven%20steps%3B%20step%201%3A%20define%20performance%20requirements" id="wpa2a_12"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/06/10/web-performance-in-seven-steps-step-1-define-performance-requirements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web performance in seven steps</title>
		<link>http://blog.xebia.com/2009/05/25/web-performance-in-seven-steps/</link>
		<comments>http://blog.xebia.com/2009/05/25/web-performance-in-seven-steps/#comments</comments>
		<pubDate>Mon, 25 May 2009 20:26:42 +0000</pubDate>
		<dc:creator>Jeroen Borgers</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/blog.xebia.com/www/wp-content/plugins/autometa/autometa.php</b> on line <b>303</b><br />
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[availability]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[speed.]]></category>
		<category><![CDATA[web shop]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=1824</guid>
		<description><![CDATA[By Jeroen Borgers More and more Internet users buy in web shops these days. Research shows that the part of European Internet users that buys on-line has grown from 40% in 2004 to 80% in 2008. Additionally, large web retailers in The Netherlands see their revenue grow just as if the recession has never materialized. [...]]]></description>
			<content:encoded><![CDATA[<p>By Jeroen Borgers</p>
<p>More and more Internet users buy in web shops these days. Research shows that the part of European Internet users that buys on-line has grown from 40% in 2004 to 80% in 2008. Additionally, large web retailers in The Netherlands see their revenue grow just as if the recession has never materialized. Business seems to be flourishing.<span id="more-1824"></span></p>
<p>I also like to shop on the web. Now and then I enter a web shop where I have to wait before pages appear fully. Most of the time I’ll move away: with just one click I’m off to the competitor. The increased comparison possibilities and freedom of choice offered by the Internet are not only valid for the products, but also for the web shops themselves. Therefore, it has become crucial for the success of the web shop to have a responsive web site. </p>
<p>With only a few concurrent visitors, it is usually not so hard to have a quick website. However, with the growing trend of Internet sales, the increasing integration and complexity of back-end systems and the by marketing demanded ever increasing richness of the user experience, this often becomes a big challenge for developers and operators. This may result in systems blacking out under high load or responding too slowly. </p>
<p>So the question is: how can we prevent these performance and availability problems and how can we assure a web site is always quick and available? </p>
<p>On the basis of real life, trial and error experience we’ve come to an approach which can be described as: measure, don’t guess; seven steps to performance success. I’ll explain this approach in the follow up blogs, and <a href="http://blog.xebia.com/2009/06/02/web-performance-in-seven-steps-how-performance-problems-manifest-themselves/">next time</a> I&#8217;ll first describe in which forms performance difficulties can present themselves. Stay tuned.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/05/25/web-performance-in-seven-steps/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F05%2F25%2Fweb-performance-in-seven-steps%2F&amp;title=Web%20performance%20in%20seven%20steps" id="wpa2a_14"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/05/25/web-performance-in-seven-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loitering objects make web company lose money</title>
		<link>http://blog.xebia.com/2008/09/15/loitering-objects-make-web-company-lose-money/</link>
		<comments>http://blog.xebia.com/2008/09/15/loitering-objects-make-web-company-lose-money/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 12:32:00 +0000</pubDate>
		<dc:creator>Jeroen Borgers</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Continuity]]></category>
		<category><![CDATA[garbage collection]]></category>
		<category><![CDATA[HPJMeter]]></category>
		<category><![CDATA[jconsole]]></category>
		<category><![CDATA[OutOfMemoryError]]></category>
		<category><![CDATA[VisualVM]]></category>

	<!-- AutoMeta Start -->
	<category>great</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=749</guid>
		<description><![CDATA[By Jeroen Borgers Recently, I was called in by a company with a website in trouble. And because they make all their money on-line, it was evident that they really wanted to have the issue solved. The day I came in, the site had gone down about 5 times the last 24 hours. Because of [...]]]></description>
			<content:encoded><![CDATA[<p>By Jeroen Borgers</p>
<p>Recently, I was called in by a company with a website in trouble. And because they make all their money on-line, it was evident that they really wanted to have the issue solved. The day I came in, the site had gone down about 5 times the last 24 hours. Because of this they got less traffic, which directly meant less revenue. The log files showed periods of long response times and OutOfMemoryErrors. Their questions were: Why do we get this behavior? and How do we fix it? My short answer turned out to be: because of too many loitering objects; and this can be fixed by not holding on to them in the HTTP session. <span id="more-749"></span>I’ll explain.</p>
<p><strong>Troubleshooting assignment</strong><br />
As often is the case in this kind of troubleshooting assignments, once you have found exactly what is wrong, you&#8217;ve almost solved it already. The difficulty is in doing the detective work of nailing down the root cause. Or differently put, finding the needle in the haystack. </p>
<p><strong>VisualVM</strong><br />
The tool they already used and actually was new to me was VisualVM.<br />
 <a href='http://blog.xebia.com/wp-content/uploads/2008/09/visualvm-about.jpg'><img src="http://blog.xebia.com/wp-content/uploads/2008/09/visualvm-about.jpg" alt="Visual VM About window" title="visualvm-about" width="500" height="312" class="alignnone size-full wp-image-754" /></a><br />
Figure 1. VisualVM About window</p>
<p>It is similar to jdk&#8217;s jconsole in that you can visually look into the JVM. It actually has a plug-in architecture by which for instance parts of jconsole are plugged into visualVm to see heap and thread usage, loaded classes and MBeans. For lower overhead than jconsole, it however has less detail in sections like heap. It also has a profiler plug-in which is the Netbeans profiler. So you can actually CPU or memory profile local applications from it. And since the recent version 1.6.0_07 the JDK has this great tool bundled with it now. In case you cannot find it in the JDK: they have renamed it to jvisualvm.</p>
<p><a href='http://blog.xebia.com/wp-content/uploads/2008/09/visualvm-heap.jpg'><img src="http://blog.xebia.com/wp-content/uploads/2008/09/visualvm-heap.jpg" alt="VisualVM monitor example showing analysis of a JMeter process" title="visualvm-heap" width="500" height="312" class="alignnone size-full wp-image-751" /></a><br />
Figure 2. VisualVM monitor example </p>
<p>VisualVM helped in that we could see in the generated stack dumps that threads were often waiting for some log4j lock. Reason being the log level was set to DEBUG. Setting it to INFO improved performance somewhat. However, in this case visualVM did not bring me the crucial facts. Reason for this was twofold. The first was the lack of detail I mentioned and the second was the type of tool, being one having to be a witness of the problem situation to be able to analyze it. </p>
<p><strong>Finding the crucial information</strong><br />
The toolset that gave me the first half of the crucial information was the -Xloggc:gc.log flag combined with HPJmeter. This gives the opportunity to analyze after the facts. That night, traffic was rather low and the site did not go down, but it was very slow during some hours. The next day, the log file showed at the time when performance became bad:<br />
<code>15045.703: [GC 1786342K->1481712K(1856512K), 0.1639990 secs]<br />
15053.886: [GC 1790320K->1489985K(1858880K), 0.1722250 secs]<br />
15065.930: [GC 1800257K->1493876K(1859968K), 0.1601460 secs]<br />
15066.090: [Full GC 1493876K->1467212K(1859968K), 3.5031310 secs]<br />
15071.966: [Full GC 1708415K->1471029K(1859968K), 3.5039160 secs]<br />
15078.215: [Full GC 1708277K->1476287K(1859968K), 3.5326720 secs]<br />
15087.847: [Full GC 1708386K->1408698K(1859968K), 4.5038550 secs]<br />
</code><br />
We see here the fall-over from doing mainly GC&#8217;s (young space) to mainly Full GC&#8217;s, so from short pauses to long pauses. Actually every 6 seconds or so, and a collection takes 3.5 s. So a lot of time is spent in gc. As you can see, however, some memory is still reclaimed. With HPJMeter I could see this in nice graphics to draw conclusions:<br />
<a href='http://blog.xebia.com/wp-content/uploads/2008/09/hpjmeter-gctime.jpg'><img src="http://blog.xebia.com/wp-content/uploads/2008/09/hpjmeter-gctime.jpg" alt="HPJmeter showing percentage of time spent in GC." title="hpjmeter-gctime" width="500" height="312" class="alignnone size-full wp-image-750" /></a><br />
Figure 3. HPJmeter showing percentage of time spent in GC.</p>
<p>So, it became clear to me that the site was so slow because up to 95% of the CPU cycles were spent on garbage collection, which left only 5% to the application itself. </p>
<p><strong>Need for more details</strong><br />
What however the reason for this excessive gc was, was not clear to me, yet. I needed more details on the memory usage. So, we switched on the -XX:+PrintGCDetails flag which gave us the second half of the crucial information.<br />
Unfortunately, HPJMeter could not deal with the produced log format, but we got lines at the start of the problems like:<br />
<code>21270.421: [GC [PSYoungGen: 436938K->112249K(481664K)] 1808785K->1489945K(1879808K), 0.1790760 secs]<br />
21277.559: [GC [PSYoungGen: 443385K->111206K(486528K)] 1821081K->1497781K(1884672K), 0.1815330 secs]<br />
21284.659: [GC [PSYoungGen: 442406K->107401K(489536K)] 1828981K->1504035K(1887680K), 0.1780120 secs]<br />
21284.837: [Full GC [PSYoungGen: 107401K->79553K(489536K)] [PSOldGen: 1396634K->1398143K(1398144K)] 1504035K->1477697K(1887680K) [PSPermGen: 79038K->79038K(262144K)], 3.5320210 secs]<br />
21292.969: [Full GC [PSYoungGen: 331200K->83102K(489536K)] [PSOldGen: 1398143K->1398143K(1398144K)] 1729343K->1481246K(1887680K) [PSPermGen: 79047K->79047K(262144K)], 3.5302490 secs]<br />
21302.663: [Full GC [PSYoungGen: 331200K->85665K(489536K)] [PSOldGen: 1398143K->1398143K(1398144K)] 1729343K->1483809K(1887680K) [PSPermGen: 79055K->79055K(262144K)], 3.4508870 secs]<br />
21311.177: [Full GC [PSYoungGen: 330681K->21303K(489536K)] [PSOldGen: 1398143K->1398144K(1398144K)] 1728825K->1419447K(1887680K) [PSPermGen: 79065K->79027K(262144K)], 4.4884740 secs]</code><br />
Again, here we see the fall-over. If you look at the old space: the first full gc puts objects from young in old making it almost full, there is only 1K or less of unused space left shown in the full GC lines. The confusion comes from the young space usage, where most garbage still can be collected. This makes the total heap not full, while the old space is at its limits. So, some things get stuck in old space. The remarkable thing is that the situation recovers after an hour or so and an OOME does not occur. </p>
<p><strong>Heap analyses with Netbeans</strong><br />
So, now it is time to do more heap analyses. Netbeans has a great built-in profiler with a useful heap analyzer. We found that most of the memory was used by Category objects, which was not intended as such. By using the heap walker we could find that references to it were mostly held from Tomcat session objects. So, each HTTP session had its own copy of these Categories and they were kept hanging around for half an hour: the default HTTP session timeout. The term for this kind of objects is: loitering objects.</p>
<p><strong>The quick and the real fix</strong><br />
At this point we could devise a quick remedy: decrease the HTTP session timeout from 30 to 5 minutes. This reduced most pressure on us fixers and gave us some air to breath. Then we created some tests and were able to reproduce the behavior in a test environment. Looking at jconsole also clearly showed the growing usage of old space.<br />
<a href='http://blog.xebia.com/wp-content/uploads/2008/09/jconsole-mem-pools.jpg'><img src="http://blog.xebia.com/wp-content/uploads/2008/09/jconsole-mem-pools.jpg" alt="JConsole showing memory usage for each memory pool" title="jconsole-mem-pools" width="250" height="156" class="alignleft size-full wp-image-755" /></a><br />
Figure 4. JConsole showing memory usage for each memory pool.</p>
<p>In the source code we could easily find the place where all category objects were loaded from the database, put in a cache once and, along the way, also a copy in each user HTTP session. For no reason really. And with 1700 user sessions this took most of the memory.</p>
<p>So, this was a no-brainer to solve in the code. And after deploying and setting back the session timeout to the default 30 minutes, problems were solved. I love it when a plan comes together.</p>
<p><strong>Learn more</strong><br />
If you want to learn more about this stuff and get hands-on experience, come to <a href="http://www.xebia.com/nl/service-offering/training-services/Speeding-up-Java-Applications.html">my class of &#8220;Speeding up Java applications&#8221; in April or November 2009</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2008/09/15/loitering-objects-make-web-company-lose-money/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2008%2F09%2F15%2Floitering-objects-make-web-company-lose-money%2F&amp;title=Loitering%20objects%20make%20web%20company%20lose%20money" id="wpa2a_16"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2008/09/15/loitering-objects-make-web-company-lose-money/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.xebia.com/tag/performance/feed/ ) in 0.87494 seconds, on Feb 9th, 2012 at 4:21 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 9th, 2012 at 5:21 pm UTC -->
