Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand RGW performance monitoring and source code implementation

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

How to understand RGW performance monitoring and source code implementation, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

1 implementation of performance counter

Performance counter startup process

# src/rgw/rgw_main.ccint main (int argc, const char * * argv)... If (glossary confession-> daemonize) {global_init_daemonize (g_ceph_context);} Mutex mutex ("main"); SafeTimer init_timer (g_ceph_context, mutex); init_timer.init (); mutex.Lock (); init_timer.add_event_after (glossy confession-> rgw_init_timeout, new C_InitTimeout); mutex.Unlock (); / / Enable the perf counter before starting the service thread gallecephobic context-> enable_perf_counter ();... R = rgw_perf_start (g_ceph_context); # enable rgw counters

Performance counter parameter description

# src/rgw/rgw_common.ccint rgw_perf_start (CephContext * cct) {PerfCountersBuilder plb (cct, cct- > _ conf- > name.to_str (), l_rgw_first, l_rgw_last); plb.add_u64_counter (l_rgw_req, "req", "Requests"); # number of requests processed successfully plb.add_u64_counter (l_rgw_failed_req, "failed_req", "Aborted requests") # number of failed requests plb.add_u64_counter (l_rgw_get, "get", "Gets"); # number of GET requests plb.add_u64_counter (l_rgw_get_b, "get_b", "Size of gets"); plb.add_time_avg (l_rgw_get_lat, "get_initial_lat", "Get latency") Plb.add_u64_counter (l_rgw_put, "put", "Puts"); # number of PUT requests plb.add_u64_counter (l_rgw_put_b, "put_b", "Size of puts"); plb.add_time_avg (l_rgw_put_lat, "put_initial_lat", "Put latency"); plb.add_u64 (l_rgw_qlen, "qlen", "Queue length") Plb.add_u64 (l_rgw_qactive, "qactive", "Active requests queue"); plb.add_u64_counter (l_rgw_cache_hit, "cache_hit", "Cache hits"); # cache hits plb.add_u64_counter (l_rgw_cache_miss, "cache_miss", "Cache miss") used to cache RGW metadata # number of misses plb.add_u64_counter (l_rgw_keystone_token_cache_hit, "keystone_token_cache_hit", "Keystone token cache hits"); plb.add_u64_counter (l_rgw_keystone_token_cache_miss, "keystone_token_cache_miss", "Keystone token cache miss"); perfcounter = plb.create_perf_counters (); cct- > get_perfcounters_collection ()-> add (perfcounter); return 0;}

The performance counter type is defined as follows

# src/rgw/rgw_common.ccenum {l_rgw_first = 15000, l_rgw_req, l_rgw_failed_req, l_rgw_get, l_rgw_get_b, l_rgw_get_lat, l_rgw_put, l_rgw_put_b, l_rgw_put_lat, l_rgw_qlen, l_rgw_qactive, l_rgw_cache_hit, l_rgw_cache_miss, l_rgw_keystone_token_cache_hit L_rgw_keystone_token_cache_miss, l_rgw_last,} 2 how to use counters

Mode 1

Root@demo# ceph--admin-daemon / var/run/ceph-client.radosgw.en-zone1.asok perf dump {"cct": {"total_workers": 32, "unhealthy_workers": 0}, "client.radosgw.en-zone1": {"req": 2, "failed_req": 2, "get": 0, "get_b": 0, "get_initial_lat": {"avgcount": 0 "sum": 0.000000000}, "put": 0, "put_b": 0, "put_initial_lat": {"avgcount": 0, "sum": 0.000000000}, "qlen": 0, "qactive": 0, "cache_hit": 0, "cache_miss": 2, "keystone_token_cache_hit": 0, "keystone_token_cache_miss": 0}

Method 2 (use Dumpling or above)

Root@demo# ceph daemon client.radosgw.en-zone1 perf dump {"cct": {"total_workers": 32, "unhealthy_workers": 0}, "client.radosgw.en-zone1": {"req": 2, "failed_req": 2, "get": 0, "get_b": 0 "get_initial_lat": {"avgcount": 0, "sum": 0.000000000}, "put": 0, "put_b": 0, "put_initial_lat": {"avgcount": 0, "sum": 0.000000000}, "qlen": 0, "qactive": 0 "cache_hit": 0, "cache_miss": 2, "keystone_token_cache_hit": 0, "keystone_token_cache_miss": 0}

Most people may not pay much attention to the performance counter, but pushing the counter data to some monitoring systems and adding some alarm policies can significantly improve the quality of operation and maintenance. At the same time, through the source code level to expand the counter type, from within the ceph to achieve some custom data statistics, is also a good functional highlight.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report