Skip to main content

Posts

Showing posts with the label performance

Gatling Load Test Tricks and Debug

Introduction: Gatling is a light weighted load generator. Though it is 'load test as code', sometimes it is hard to debug. Especially when there is lack of documentation and tutorial. I run into an issue when upgrading from 2.3.1 to 3.0.2. The error message is not very helpful. Here I will show this case to illustrate an upgrading issue, as well is tricks to print out some debug information. Some Debug Tricks: According to  gatling document , you can print out debug information in 2 ways. change conf/logback.xml to DEBUG/TRACE for logger name="io.gatling.http.engine.response" This generates too much information and my tests times out.  Use println in exec. This is more flexible and can prints the exact information I need. How ever I would like to put the debug messages in a separate file. Here is an example: val file = System.getProperty("file", "/tmp/debug_cookie.out") val scn = scenario(myReadScenario) .during (myDur...

Disk IO performance diagnose and improvement on CentOS

System Stats when I/O Might Be the Bottleneck: 1. iostat -x <delay> <repeats> shows the io for each device: Device: rrqm/s   wrqm/s   r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util sdb     0.00   121.67    0.00  454.67  0.00  7696.00    33.85      0.06    0.12    0.00    0.12   0.04    1.97 sda     0.00     3.00    0.00   5.33   0.00   857.33    321.50     0.07   12.31    0.00   12.31   2.12   1.13 avg-cpu:  %user   %nice %system %iowait  %steal   %idle           3.58    0.00    0.69    0.08    ...

G1GC Performance Tuning Parameters

G1GC Performance Tuning Parameters In this post, I will list some common observations from G1GC logs, and the parameters you can try to tune the performance. To print GC logs, please refer to  my blog about how to print gc logs . Threads Related In JDK9, with -Xlog:gc*=info, or -Xlog:gc+cpu=info, you can get log entry like: [12.420s][info][gc,cpu      ] GC(0) User=0.14s Sys=0.03s Real=0.02s This can give you some indication about the cpu utilization for the GC pause. For example, this entry indicates for this gc pause, total user-cpu is 0.14s, wall time is 0.02s, and system time is 0.03s. The ratio of User/Real could be used as an estimation of number of gc threads you need. For this case, 18 gc threads should be good. If you see long termination time,  User/Real less than the gc threads, you can try to reduce the number of gc threads. Here is a list of threads related parameters: Name ...
How to Convert JDK8 GC Log Flags to JDK9 with Unified Logging: Introduction: JDK9 introduced unified logging for all JDK9 components. It provides a way for the users to configure the content of the logs. Since all the logs follow the unified format, it would make parsing easier. Users might have some difficulty finding the right tags and levels in JDK9, especially when migrating from JDK8.  This post provides some basic back ground about unified logging in JDK9, and tags and levels in JDK9 corresponding to JDK8 flags for GC logging. JDK9 Unified Logging: With a JDK9 build, you can logging help by "java -Xlog:help". Here is the output from the command ./bin/java -Xlog:help -Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]] where 'what' is a combination of tags and levels on the form tag1[+tag2...][*][=level][,...] Unless wildcard (*) is specified, only log messages tagged with exactly the tags specified will be matc...