kmesh-net / kmesh

High Performance ServiceMesh Data Plane Based on Programmable Kernel
https://kmesh.net
Apache License 2.0
362 stars 46 forks source link

Add proposal for circuit breaker #397

Open Okabe-Rintarou-0 opened 1 month ago

Okabe-Rintarou-0 commented 1 month ago

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

kmesh-bot commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign hzxuzhonghu for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kmesh-net/kmesh/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
unittests 31.10% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

hzxuzhonghu commented 4 weeks ago

I didnot see the response recording, how could we achieve that?

Okabe-Rintarou-0 commented 4 weeks ago

I didnot see the response recording, how could we achieve that?

can we use this https://github.com/weaveworks-plugins/scope-http-statistics/blob/master/ebpf-http-statistics.c?

I'm busy for taking examines these two weeks, so my progress may be slow recently.

Okabe-Rintarou-0 commented 4 weeks ago

Can we maintain a statistic structure map in ebpf (so that can be accessed in user space), recording http statistic information like: number of connections, number of requests. We hook some functions in ebpf to collect this info, and we can do circuit breaker logic using golang in user space.

hzxuzhonghu commented 4 weeks ago

Agree, there need response handling

Okabe-Rintarou-0 commented 4 weeks ago

I tried https://eunomia.dev/zh/tutorials/23-http/, works.

127.0.0.1:59434(src) -> 127.0.0.1:8000(dst)
payload: GET / HTTP/1.1
Host: 0.0.0.0:8000
User-Agent: curl/7.81.0
Acc
127.0.0.1:8000(src) -> 127.0.0.1:59434(dst)
payload: HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/3.10.12
Date: Tu