zifeihan edited a comment on issue #6472:
URL: https://github.com/apache/skywalking/issues/6472#issuecomment-809159923
@wu-sheng @xuanyu66 @EvanLjp I have also encountered the problem of es
holding a lot of objects. in addition to multi-threaded writing, I also made an
optimization here. I rewritten the buildBatchRequests method in
MetricsPersistentWorker and added a parameter for batch writing. , Is to avoid
frequent updates of hourly and day indicators. In addition, I made a time
window to write one minute of data asynchronously (window period). If the
current one minute has passed, then use synchronous writing. We have observed
that the effect is good. hope some suggestions.
like this
```
public void buildBatchRequests(List<PrepareRequest> prepareRequests) {
if ((batchFactor == 0) || (Math.abs(batchCount.getAndAdd(1)) %
batchFactor == 0)) {
prepareBatch(getCache().read(), prepareRequests);
}
}
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]