Understand the SLA/SLO/SLI

1 如何区分SLA/SLI/SLO:

  • SLI,服务质量指标,服务的某项质量的一个具体的量化指标,如时延、吞吐量、错误率等。
  • SLO,服务质量目标,服务的某项 SLI 的具体目标值,或者目标范围,如 99% 访问延迟 < 500ms。
  • SLA,服务质量协议,描述在服务不达 SLO 情况下的后果,可简单理解为 “SLA = SLO + 后果(惩罚)”。

    场景

    某外卖平台承诺为用户提供快速且高效的送餐服务,餐厅、骑手、平台以及顾客都会关注服务的质量和速度。

    概念 对象 定义 案例
    SLI(Service Level Indicator) 数据/指标 用于衡量服务表现的数据 实际送餐时间是 25 分钟
    SLO(Service Level Object) 内部目标 平台设定的服务标准目标 95% 订单 30 分钟内送达
    SLA(Service Level Agreement) 用户/商家 明确的服务承诺和赔偿条款 超过 30 分钟赔偿优惠券

Down机时间计算:以为单位,可以网站查询:https://uptime.is/99.5

<99.99%

4.3m

<99.95%

21.6m

<99.9%

43.2m

<99.5%

3h 37m 21s

<99.0%

432m(7.2h)

<95%

2160m(36h)



SLO1 = 1 – T2/(T1+T2+T3+T4)
SLO2 = 1 – T3/(T1+T2+T3+T4)
总体: SLO = 1 – (T2+T3)/(T1+T2+T3+T4)

AWS实例级和区域级SLA区别:
实例级SLA: 单个EC2. 实例的实例级正常运行时间百分比至少达到99.5%(“实例级SLA”)
区域级SLA: 对于同时部署在同一区域(或者如果给定区域只有一个. AZ,则至少两个区域)的两个或多个AZ 中的所有运行中实例的Amazon EC2, 正常运行时间百分比至少达到99.99%
https://d1.awsstatic.com/legal/AmazonComputeServiceLevelAgreement/Amazon_Compute_Service_Level_Agreement_Chinese_Simplfied_(CN)2022-05-25.pdf

kafka command

root@ip-10-0-56-54:~# /usr/local/kafka_2.13-3.4.1/bin/kafka-dump-log.sh –files /asyncmq/kafka/data3/asyncmq_local_us_kafka_cluster_01_29bb15a7-339e-3c4d-b559-5f39214c250b-0/00000000000004353579.index  –print-data-log|more
Dumping /asyncmq/kafka/data3/asyncmq_local_us_kafka_cluster_01_29bb15a7-339e-3c4d-b559-5f39214c250b-0/00000000000004353579.index
offset: 4353580 position: 34112
offset: 4353581 position: 70021
offset: 4353582 position: 104109
offset: 4353583 position: 138180
offset: 4353584 position: 172201
offset: 4353585 position: 207647
offset: 4353586 position: 241803

/usr/local/kafka_2.13-3.4.1/bin/kafka-dump-log.sh –files /asyncmq/kafka/data3/asyncmq_local_us_kafka_cluster_01_29bb15a7-339e-3c4d-b559-5f39214c250b-0/00000000000004167765.log –print-data-log

baseOffset: 2816434 lastOffset: 2816434 count: 1 baseSequence: 0 lastSequence: 0 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 4 isTransactional: false isControl: false deleteHorizonMs: OptionalLong.empty position: 0 LogAppendTime: 1696861264970 size: 1242 magic: 2 compre
sscodec: none crc: 3906560868 isvalid: true
| offset: 2816434 LogAppendTime: 1696861264970 keySize: 36 valueSize: 1136 sequence: 0 headerKeys: [] key: 317654a5-5ff3-4b22-acef-624ee1d5f2c3 payload: {“XXXXX”}

baseOffset: 2816435 lastOffset: 2816435 count: 1 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 4 isTransactional: false isControl: false deleteHorizonMs: OptionalLong.empty position: 1242 LogAppendTime: 1696861264989 size: 1408 magic: 2 c
ompresscodec: none crc: 500155102 isvalid: true
| offset: 2816435 LogAppendTime: 1696861264989 keySize: 36 valueSize: 1302 sequence: -1 headerKeys: [] key: 3b93459a-adb3-4ab9-8377-db087a233666 payload: {“XXXXX”}

 

root@ip-10-0-56-54:~# /usr/local/kafka_2.13-3.4.1/bin/kafka-dump-log.sh –files /asyncmq/kafka/data3/asyncmq_local_us_kafka_cluster_01_29bb15a7-339e-3c4d-b559-5f39214c250b-0/00000000000004322573.timeindex –print-data-log |more
Dumping /asyncmq/kafka/data3/asyncmq_local_us_kafka_cluster_01_29bb15a7-339e-3c4d-b559-5f39214c250b-0/00000000000004322573.timeindex
timestamp: 1697055992377 offset: 4322574
timestamp: 1697055992406 offset: 4322576
timestamp: 1697055992448 offset: 4322577
timestamp: 1697055992455 offset: 4322578
timestamp: 1697055992480 offset: 4322579
timestamp: 1697055992488 offset: 4322580