peng-yongsheng commented on issue #1032: Collector performance optimization
URL: 
https://github.com/apache/incubator-skywalking/issues/1032#issuecomment-379450223
 
 
   ## Report digest
   ```
   metric name: /persistence, avg: 372859, rate: 0, calls: 100039, total: 37(s)
   metric name: /segment/parse, avg: 274427, rate: 0, calls: 56000, total: 15(s)
   metric name: /persistence/get, avg: 2828750, rate: 0, calls: 4464, total: 
12(s)
   ```
   Those points could be a source of performance bottlenecks.
   
   ## Performance optimization
   ### Segment parse
   #### Change cache component from Guava to Caffeine, [ Caffeine's 
Benchmarks](https://github.com/ben-manes/caffeine/wiki/Benchmarks#read-100)
   ```
   metric name: /persistence, avg: 194719, rate: 0, calls: 98341, total: 19(s)
   metric name: /segment/parse, avg: 260367, rate: 0, calls: 56624, total: 14(s)
   metric name: /persistence/get, avg: 1587150, rate: 0, calls: 4032, total: 
6(s)
   ```
   #### Make all the loggers class variable to have the static modifier.
   ```
   Before:
   /segment/parse
        Avg=636584 (nanosecond), Success Rate=100%, Calls=14000, 
Total=8912189125 (nanosecond)
   
   After:
   /segment/parse
        Avg=524138 (nanosecond), Success Rate=100%, Calls=14097, 
Total=7388775602 (nanosecond)
   ```
   
   #### Time stamp format to time bucket performance optimization.
   ```
   Before:
   /segment/parse
        Avg=557410 (nanosecond), Success Rate=100%, Calls=14139, 
Total=7881231734 (nanosecond)
   /utils/timeBucket/getSecondTimeBucket
        Avg=9768 (nanosecond), Success Rate=100%, Calls=17417, Total=170135908 
(nanosecond)
   /utils/timeBucket/getMinuteTimeBucket
        Avg=7384 (nanosecond), Success Rate=100%, Calls=82536, Total=609514865 
(nanosecond)
   
   After:
   /segment/parse
        Avg=503868 (nanosecond), Success Rate=100%, Calls=14085, 
Total=7096993057 (nanosecond)
   /utils/timeBucket/getSecondTimeBucket
        Avg=13636 (nanosecond), Success Rate=100%, Calls=3664, Total=49964432 
(nanosecond)
   /utils/timeBucket/getMinuteTimeBucket
        Avg=6148 (nanosecond), Success Rate=100%, Calls=27512, Total=169161105 
(nanosecond)
   ```
   
   #### Instance of and time bucket transform
   1. Add contains point method instead instance of for decide span listener 
class type.
   1. Transform minute time bucket just once.
   
   ```
   Before:
   /segment/parse
        Avg=503868 (nanosecond), Success Rate=100%, Calls=14085, 
Total=7096993057 (nanosecond)
   After:
   /segment/parse
        Avg=81916 (nanosecond), Success Rate=100%, Calls=455534, 
Total=37315774880 (nanosecond)
   ```
   
   ### Storage
   #### Short Column Name and fixed a persistence timer bug
   TPS before: 6k,   after: 10k
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to