Gauge and Counter allocate alot of memory
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- observability
Hướng nghiên cứu
Bắt đầu bằng cách chạy trình tái hiện Python được cung cấp với prometheus-client 0.17.0 và Python 3.9, đo cả từng đối tượng metric riêng lẻ lẫn prometheus_client.REGISTRY. Hoàn thành có nghĩa là xác định liệu các lần cấp phát được báo cáo có nằm trong dự kiến hay xác định một hồi quy bộ nhớ cụ thể, kèm theo mục tiêu kiểm thử hoặc tài liệu tập trung nếu repository cung cấp một mục tiêu như vậy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hey, I've noticed that a prometheus Gauge or Counter object needs alot of memory. Is this a normal/expected behaviour?
import prometheus_client
import objsize
labels={}
labels['test']='test'
print("Memory Registry at Start: " +str(objsize.get_deep_size(prometheus_client.REGISTRY)))
print("Memory Labels as dict: "+ str(objsize.get_deep_size(labels)))
gauge = prometheus_client.Gauge("test", "", list(sorted(labels.keys())))
gauge.labels(**labels).set(10)
print("Memory Gauge object: "+ str(objsize.get_deep_size(gauge)))
print("Memory Registry after one Gauge: "+str(objsize.get_deep_size(prometheus_client.REGISTRY)))
gauge2 = prometheus_client.Gauge("test2", "")
gauge2.set(10)
print("Memory Gauge object: "+ str(objsize.get_deep_size(gauge2)))
print("Memory Registry after second Gauge: "+str(objsize.get_deep_size(prometheus_client.REGISTRY)))
counter = prometheus_client.Counter("test3", "", list(sorted(labels.keys())))
counter.labels(**labels).inc(10)
print("Memory counter object: "+str(objsize.get_deep_size(counter)))
print("Memory Registry after Counter: "+str(objsize.get_deep_size(prometheus_client.REGISTRY)))
labels={}
labels['test']='test2'
gauge.labels(**labels).set(10)
print("Memory Gauge second label: "+str(objsize.get_deep_size(gauge)))
print("Memory Registry end: "+str(objsize.get_deep_size(prometheus_client.REGISTRY)))
results in this memory usage:
Memory Registry at Start: 3988
Memory Labels as dict: 285
Memory Gauge object: 2418
Memory Registry after one Gauge: 6725
Memory Gauge object: 1051
Memory Registry after second Gauge: 7723
Memory counter object: 2108
Memory Registry after Counter: 10027
Memory Gauge second label: 3376
Memory Registry end: 10931
In this Blog Post https://www.robustperception.io/memory-usage-of-prometheus-client-libraries/ ( I know it's old) a counter needed way less memory than in my usecase. I'm using python 3.9, on windows(but i've got the same problem in a docker container) and prometheus-client 0.17.0
- Ngôn ngữ chính
- Python
- Star
- 4.4k
- Fork
- 876
- Merge trung bình
- 8 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của prometheus/client_python
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
prometheus/client_python#1177 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
prometheus/client_python#1210 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
prometheus/client_python#1199 · 1 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
prometheus/client_python#1176 ·
-
WSL and MultiProcessCollector Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 52/100
prometheus/client_python#1126 · 2 bình luận ·
Tất cả issue của prometheus/client_python
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·