<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 41  文章 - 29  trackbacks - 0
    <2009年3月>
    22232425262728
    1234567
    891011121314
    15161718192021
    22232425262728
    2930311234

    常用鏈接

    留言簿(5)

    隨筆分類(28)

    隨筆檔案(23)

    收藏夾(6)

    Inside JVM

    Java

    java performance

    Solr

    搜索

    •  

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    Recently, our performance testing result is being very strange: suddenly much slower or much faster than the previous testing. This situation lasts for a pretty long time. And the unstable testing result makes us very confusing and doesn't believe anything and caused lots of back and forward work (such as testing scripting changes).
    However, it is normal cases of performance testing. We have to face it. This article is trying to explain why the performance testing result is always changing and how can we avoid it.

    NOTE: this article just introduced some basic ideas, i hope more discussion on this topic and finally we are not confusing any more.

    The Performance of Java Application is Not Stable Inherently?

    Measuring the performance and understanding the behaviour of Java programs is challenging. Many factors, from program characteristics, VM techniques and implementations, and OS strategies, DB Optimization to hardware platform performance, can affect the final measured performance. 

    1. What's the status of hardware?

    As we all know, hardware is the basic of performance. However, we don't know what's the exact performance benchmark of our hardware? Most of people may notice one fact: two computers may perform very differently even they have the exact same hardware. So, we need some tool to compare them. 
    Even for the same machine, we are always noticing that server's status varies vastly at different times. We cannot assume the server is always perform at the same level. Disk maybe become slower and slower. A virus maybe absorbed CPU time crazily. Another process maybe occupied huge memory.

    2. JVM Optimization

    As we know, Sun HotSpot JVM actually includes both a dynamic compiler and a virtual machine to interpret bytecodes, as shown in the following figure.


    When bytecodes are first loaded, they are run through the interpreter. The profiler keeps a record of runtimes for each method. When a method is found to be taking a lot of time, HotSpot compiles and optimizes it. Every future call to that method uses the native machine instructions produced by the compiler.

    As with a JIT, the results of the compilation are not kept between runs. Because the bytecodes are more compact, this saves loading time as well as storage space. It also retains portability, and allows the optimization to reflect the way the program is currently being used. Currently, no attempt is made to save information that might help future runs become efficient more quickly.

    In other words, HotSpot JVM will optimize some critical methods during runtime. So, the execution time of each method will change during the execution time. 

    3. SQL Server Optimization

    MS SQL Server is a very powerful database. It will do lots of optimization to improve query performance at runtime. SQL Server Performance Optimization is a very complicated topic, here we just try to emphasize some points -
    (1)As you see from the following diagram, any single statement will optimized into Query Plan by Query Optimizer based on query statements, database schema and statistics. SQL Server 2005 has a pool of memory that is used to store both execution plans and data buffers. The percentage of the pool allocated to either execution plans or data buffers fluctuates dynamically, depending on the state of the system. SQL Server 2005 has an efficient algorithm to find any existing execution plans for any specific SQL statement. In most systems, the minimal resources that are used by this scan are less than the resources that are saved by being able to reuse existing plans instead of compiling every SQL statement.
     
    (2) Disk I/O is a core characteristic of the Database. SQL Server has one component named Buffer management will try to mange the reading and writing database pages and cache database pages to reduce file I/O. It is also a dynamic process. 

    4. Application Errors 

    Another very importance factor impacting application performance result is application runtime errors. As most of us noticed again and again, the application error will greatly impact the stability of the server  and make the server very unstable.
    The recent example is, SM performance testing finds that the latest performance testing is much slower that the pervious testing and the thoughout is very unstable during the testing. However, if one of the report testing is removed from testing scripts, the performance testing is much slower and the result is much reasonable. As we all know, the report component is one of the root cause of server crash and out-of-memory issues. So, if we try to test the performance with report module, the result doesn't make much sence.  

    How can we get trusted result?

    1. Fix Errors Before Testing

    First of all, please fix the errors. There are several errors we must notice:
    (1) Lots of Exceptions on log file
    (2) Server crash issue and out-of-memory issue
    No serious error is the precondition of the stable performance testing result.

    2. Run benchmark tool before running application

    There are lots of good PC performance benchmark tool, i selected PassMark Performance Testing (http://www.passmark.com/download/pt_download.htm) which is very easy to use, understand and compare.


    I did a quick testing on my laptop and one of the high-performance server. The result shows huge differences -


    Overall

    CPU

    Memory

    Disk

    My Laptop

    388.9

    943.5

    441.3

    155.4

    High-Performance Server

    1627.4

    3155.9

    835.7

    1541.2

    Comparison Result

    around 4.2 times

    around 3.5 times

    around 2 times

    aournd 9.9 tiems


    The results displays the Disk is the biggest difference among these two servers. So, the disk-sensitive operations may impact the overall performance if the testing is running at my laptop.


    Another very interesting benchmark is JVM benchmark tool (SPECjvm2008, http://www.spec.org/jvm2008/docs/UserGuide.html), which is designed to measure the performance of a JRE (a JVM and associated libraries). It also measures the performance of the operating system and hardware in the context of executing the JRE. It has a complicated evaluation process, and we may only need see the final result. The following is an example -

    the score pf My Laptop is 35.6 ops/m, while the score of high-performance server is  51.8 ops/m.

    3. A Little Bit Long Time Running

    As we saw in the previous section, modern software applied so many optimization techniques during runtime, so the response time is changing during the testing. Giving a little bit more time as the warm-up time is reasonable. However, how-long it need need trade-off and the support of experiences. 
     

    4. Dig into Enough Detail (even single line of code if need)

    Last but actually most important, not be fooled by a overall result. Because performance testing and tuning is very time-consuming activity and need a lot of patience, we always try to get evidence or clues from a big picture. However, a big picture or overall result is always in changing, it cannot tell you much on the real performance from testing and tuning perspective. Generally, the product-wide multiple functionality testing can be used as an overall summary of product performance, but it is not beneficial on bottleneck trouble shooting.

    The only way to find the real performance issue is trying to dig into detailed module/function/even single line of code or query. Only based on these detailed, you have the confidence to say the tuning works or not.


     In summary, we always met the performance result stability issue during performance testing. This article tries to explain why an java application will perform differently at different time, there are too many factors impacting this, and how can we get a more trustable results. This article is a first try to explain this topic, i hope more and more discussion will make us clearer. 



    posted on 2009-03-09 23:25 Justin Chen 閱讀(1532) 評(píng)論(1)  編輯  收藏 所屬分類: Performance

    FeedBack:
    # re: Why Performance Testing Result is NOT Stable - How can we avoid it? 2009-03-22 06:40 duguo
    If you have monitors to the key resources, such as cpu or io, it should tell you more information about your application status.

    Good luck  回復(fù)  更多評(píng)論
      

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 亚洲?V无码乱码国产精品| 亚洲人成图片小说网站| 美景之屋4在线未删减免费| 亚洲日本va午夜中文字幕久久| 在线免费观看伊人三级电影| 久久国产亚洲高清观看| 永久免费视频v片www| av永久免费网站在线观看| 亚洲不卡中文字幕| 国产亚洲欧洲Aⅴ综合一区 | 免费人成在线观看网站视频| 91成人免费观看在线观看| 亚洲国产韩国一区二区| 免费一级特黄特色大片在线| 99视频在线免费看| 亚洲精品久久久久无码AV片软件| 国产成人99久久亚洲综合精品| 一区二区免费视频| 黄页网站在线免费观看| 中文字幕亚洲精品| 亚洲日本va午夜中文字幕久久| 91香蕉成人免费网站| gogo免费在线观看| 亚洲综合色一区二区三区| 亚洲一区二区三区免费| jlzzjlzz亚洲jzjzjz| 综合亚洲伊人午夜网 | 午夜视频免费成人| 国产精品免费观看调教网| 免费无码国产V片在线观看| 亚洲导航深夜福利| 亚洲日韩欧洲无码av夜夜摸| 精品久久免费视频| 亚洲免费二区三区| 一本色道久久综合亚洲精品蜜桃冫 | 亚洲男女性高爱潮网站| 亚洲小说区图片区另类春色| 国产美女a做受大片免费| 亚洲免费人成视频观看| 一个人免费视频观看在线www| 免费一级做a爰片久久毛片潮|