Ferrari6 opened a new pull request #7409:
URL: https://github.com/apache/pinot/pull/7409


   ## Description
   this commit fixes #7403 
   
   ### Background
   > When we used jsonpath transformation functions, we found that there was a 
delay in consumption, and the CPU usage was very high. Analysis of jstack found 
that the consumption threads were waiting for the lock of LRUCache in jayway, 
and further analysis of the CPU and lock contented, we can confirm that this 
inefficient LRUCache is the consumption performance bottleneck.
   
   **stack trace**
   
![image](https://user-images.githubusercontent.com/89431368/132486165-b1d0680f-9bf2-423b-9dcb-31afd3a5e8e4.png)
   
    _**flamegraphs can be found in the issue descriptions #7403 **_
   
   ### Fix
   A new JSON path cache is implemented using ConcurrentHashMap, and the cache 
threshold is set at the same time. When the maximum is exceeded, the JSON path 
will not be cached anymore.
   
   - In Pinot, the number of JSON paths is bounded by the size of the 
transformation config
   - Even if it exceeds the maximum cache size, not cache JSON path may be 
better than frequent swapping in and out of LRU
   - If JSON path compile is not cached, CPU consumption is also very small
   
   ### 
   
   ```
   "transformConfigs": [
           {
             "columnName": "id",
             "transformFunction": "jsonPathString(report,'$.identifiers.id','')"
           },
          {
             "columnName": "name",
             "transformFunction": 
"jsonPathString(report,'$.identifiers.name','')"
           },
    ...
   ]
   ```
   
   
   ### Pinot Server Flamegraphs when using ConcurrentHashMap cache (28vcpu)
   
   
![image](https://user-images.githubusercontent.com/89431368/132490363-43887dfc-895c-4569-9228-e135149f9f9c.png)
   
![image](https://user-images.githubusercontent.com/89431368/132490522-d0faca18-ff77-4afa-a80c-2a0c7583eb8b.png)
   **jsonpath CPU usage is low and no lock contentions**
   -->
   ## Upgrade Notes
   Does this PR prevent a zero down-time upgrade? (Assume upgrade order: 
Controller, Broker, Server, Minion)
   * [ ] Yes (Please label as **<code>backward-incompat</code>**, and complete 
the section below on Release Notes)
   
   Does this PR fix a zero-downtime upgrade introduced earlier?
   * [ ] Yes (Please label this as **<code>backward-incompat</code>**, and 
complete the section below on Release Notes)
   
   Does this PR otherwise need attention when creating release notes? Things to 
consider:
   - New configuration options
   - Deprecation of configurations
   - Signature changes to public methods/interfaces
   - New plugins added or old plugins removed
   * [ ] Yes (Please label this PR as **<code>release-notes</code>** and 
complete the section on Release Notes)
   ## Release Notes
   <!-- If you have tagged this as either backward-incompat or release-notes,
   you MUST add text here that you would like to see appear in release notes of 
the
   next release. -->
   
   <!-- If you have a series of commits adding or enabling a feature, then
   add this section only in final commit that marks the feature completed.
   Refer to earlier release notes to see examples of text.
   -->
   ## Documentation
   <!-- If you have introduced a new feature or configuration, please add it to 
the documentation as well.
   See 
https://docs.pinot.apache.org/developers/developers-and-contributors/update-document
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to