-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestions for optimizing metric data query/writing in Sentinel dashboard #1174
Comments
Good idea. Discussions and contributions are welcomed! You could also integrate with external storage (e.g. InfluxDB, Prometheus) based on the |
我现在是这样做的。历史数据存储在HBase.每天1.5E 保留三十天。5分钟的实时数据还是存储内存查询(避免频繁查询Hbase 增加查询压力),所以对实时数据写入/查询 进行了这个优化。优化之前, 各种加锁操作 导致很多监控数据不能及时写入内存。下一次聚合数据就又来了。。。。最后恶性循环 慢慢的任务就被丢弃。。。最终实时监控数据 就消失掉了。。。。现在优化过后。已经不存在这个问题了。我们线上是200台机器 50个应用。 |
细化到服务接口维度会更好~ |
Refine to the service interface dimension can be better ~ |
Close due to #1319 |
目前 sentinel dashaboard应用数据写入内存/查询 使用的是简单粗暴的synchronize,所有的读/写请求 都是串行处理,当接入的应用较多,写入内存的数据量较大,存在性能问题。建议优化这部分代码,这里给出我的思路以及实现。
1.监控数据按照应用维度 进行锁分离;
2.同一应用 进行读写锁分离;
代码大致如下:
// app -> lock
private Map<String, ReadWriteLock> appLockMap = new ConcurrentHashMap(); //app 读写锁
readWriteLock.writeLock().lock();
监控数据写内存操作;
readWriteLock.writeLock().unlock(); //释放写锁
appLockMap.get(app).readLock().lock();
排序/查询数据操作
appLockMap.get(app).readLock().unlock();
The text was updated successfully, but these errors were encountered: