当前位置:网站首页>CLB O & M & operation best practices - big insight into access logs

CLB O & M & operation best practices - big insight into access logs

2022-06-24 01:31:00 Log service CLS assistant

author :v god

Introduction : Cloud native log service (Cloud Log Service,CLS) It is a one-stop service provided by Tencent cloud Log data Solution platform , Provides data collection from logs 、 Log storage to log retrieval , Chart analysis 、 Monitoring alarm 、 Log delivery and other services , Assist users to solve business problems through logs Operation and maintenance 、 Service monitoring 、 Log audit and other scenarios .

CLB Access log big insight

Load balancing CLB As hundreds of billions QPS Gateway products , Fine operation is very important , and CLB The access log is a powerful tool .

adopt CLB Access log , We can mine massive amounts of data value , Not only can client requests be monitored from the access log 、 Assist in troubleshooting 、 You can also analyze and sort out user behavior , Provide data support for operational roles .

CLB: Load balancing (Cloud Load Balancer,CLB) Provide safe and fast traffic distribution service , Access traffic through CLB It can be automatically assigned to multiple cloud servers in the cloud , Expand the service capabilities of the system and eliminate single points of failure . Load balancing supports 100 million level connections and 10 million concurrent levels , Easy to handle high traffic , Meet business needs .

In this issue, we mainly introduce how to use CLS analysis CLB Access log .

Operation and maintenance monitoring

scene

Xiao Qin is a classmate in charge of the operation and maintenance of an Internet business advertising platform , Recently, I often meet the challenge of advertisers : What's wrong with the slow response of users clicking on our ads on your platform . In many cases, advertising partners have high requirements for timeliness and stability , Mr. Qin asked if there was any abnormal service , such as 1min Internal alarm ,5min Internal solution .

Xiao Qin was at a loss , Thought it over , Need to use CLB The log has the following capabilities :

  • ​ The access delay to the client , Abnormal request monitoring , Alarm above a certain threshold ;
  • Alarm appears , There is additional information to help determine the cause of the fault :
    • Which websites are visited by requests whose latency is higher than the threshold , Which? LB Instance and backend RS The server ;
    • LB Instance and backend RS Server delay statistics .

CLS Logging solutions

be based on CLS Of 1min Real time alarm and multidimensional analysis capability , Users can quickly target CLB Access logs for O & M monitoring , Quickly locate abnormal problems and repair faults .

1. First , Turn on CLB Access log posting CLS.

In load balancing " Instance management " On the page , Click load balancing ID, Can be opened “ Log posted to CLS”. As shown in the figure below , Refer to... For detailed operation steps : Configure access logs .

“ essential information ” Page “ Access log ( Seven layers )” modular

2. Configure the alarm strategy for client access delay and abnormal request monitoring .

Client access delay statistics :

* | select time_series(__TIMESTAMP__, '1m', '%Y-%m-%d %H:%i:%s', '0') as time, round(avg(request_time)*1000,2) as " Average access delay " group by time order by time limit 1000

Exception request statistics :

status:>200 | select time_series(__TIMESTAMP__, '1m', '%Y-%m-%d %H:%i:%s', '0') as time, status, count(1) group by time,status order by time limit 1000
Exception request statistics and client access delay statistics
  • Configure alarm policy , Detect the average delay per minute , Above threshold alarm .
Configure alarm policy
  • Multidimensional analysis is configured in the alarm strategy , When an alarm occurs , With additional information :
    • LB Instance and backend RS Server delay statistics ;
    • Which websites are visited by requests whose latency is higher than the threshold , Which? LB Instance and backend RS The server .
Multidimensional analysis
  • Configure notification channels , The following channels can be supported :
    • mail
    • SMS
    • WeChat
    • Enterprise WeChat
    • Telephone
    • Custom interface callback
Notification channels

3. Receive alarms , Rapid positioning .

Once the alarm is triggered , WeChat 、 Enterprise WeChat 、 SMS 、 Telephone and other terminals receive alarm information and details :

Alarm information page

Alarm details , See the affected RS example ,LB Examples and other information .

Alarm details page

It is known from the alarm information ,LB The average instance delay is high , Affected by LB Examples are mainly 9.*****.1. Xiao Qin of the operation and maintenance department has found an abnormality LB Instance and repair , The overall time consumption is only 1 minute .

Operation statistics

Actually CLB The access log can not only become the right assistant of the operation and maintenance students , At the same time, it is also a tool for operating students “ tool ”.

scene

A scientific and technological content APP I hope to plan an offline salon next month , On the one hand, it increases the stickiness of stock users , On the other hand, take this opportunity to publicize products , Pull new users . The preparation time is short , Limited funding , How to make use of limited resources , Finish as much as possible KPI The goal is . Xiaoting, the operation classmate, pondered hard , List the information you need to know :

  • Where will the offline salon be held : Need to know the geographical source of access to customers , Understand the geographical location of key customer groups ;
  • What is the theme of the Salon : Statistics hot sites TOP Sort , Understand what content blocks users pay more attention to ;
  • What clients are currently used by users to access : For the current client distribution , Focus on the design of landing page ;
  • Which channels are the landing pages put in : Statistics of current website request sources , Look for the diversion entrance with high flow and focus on advertising .

Let's see how to use CLB Visit the log to easily solve the urgent needs of the operation students ~

1. Understand the geographic sources of access to customers : utilize CLS Provide IP function , The client ip Convert to the corresponding province or country .

China distribution :

* | select count(1) as c, ip_to_province(remote_addr) as address group by address limit 100

Global distribution :

* | select count(1) as c, ip_to_country(remote_addr) as address group by address limit 100
Regional statistical distribution

2. Statistics hot sites TOP Sort :http_host The domain name of the access request is recorded , Request domain name by statistics pv,uv, You can count top host Sort .

* | select http_host, count(*) as pv, count(distinct(remote_addr)) as uv group by http_host order by pv desc limit 100
Hot website statistics bar chart

3. Statistics of client distribution .

* | select http_user_agent, count(*) group by http_user_agent
Client distribution pie chart

4. Statistics of current website request sources :http_referer Field records where the site's requests come from .

* | select http_referer, count(*) as count group by http_referer order by count desc limit 100
Statistics of website request sources

CLB Access log data mining

CLB Load balanced access logs can also tap a lot of value , such as pv,uv Trend Statistics , Client message traffic statistics , Status code distribution ,P99,P95 Access delay, etc . To help users quickly analyze CLB Access log ,CLS and CLB Jointly create a visual analysis scheme out of the box , The user only needs to open CLB Access log posting CLS, Enjoy immediately !

Operation steps

  1. land Console , Turn on CLB Access log posting CLS, See documentation Load balancing access log configuration .
  2. open Visual dashboard .
Visual analysis of log data

The above is the current issue CLB Access log play sharing , If you have more interesting logging practices ,

Welcome to scan and follow us , Contribute and share !

One stop log data solution platform

The articles :

【 Technology planting grass 】 This year's 11.11 The activity should put Tencent cloud “ Bring down ” 了 !!!

CLB The core of the log is how you play Get Have we arrived ?

【 The log service CLS】 Tencent cloud log service CLS Access to the content distribution network CDN

【 Tencent cloud log service CLS】serverless In application CLS Service details

【 The log service CLS】Nginx Access log retrieval 、 Analysis examples

原网站

版权声明
本文为[Log service CLS assistant]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/11/20211117190418125t.html