You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2024/01/09 03:21:23 UTC
(skywalking) branch master updated: Document a new way to load balance OAP (#11737)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new b900fd0bb5 Document a new way to load balance OAP (#11737)
b900fd0bb5 is described below
commit b900fd0bb5fe4fc388477896982cfd7e09530d5a
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Tue Jan 9 11:21:18 2024 +0800
Document a new way to load balance OAP (#11737)
---
docs/en/changes/changes.md | 1 +
docs/en/setup/backend/backend-load-balancer.md | 71 ++++++++++++++++++++++++--
docs/menu.yml | 2 +-
3 files changed, 70 insertions(+), 4 deletions(-)
diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index 5e37c09535..6d7366ab91 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -31,5 +31,6 @@
* Add `SWIP-2 Collecting and Gathering Kubernetes Monitoring Data`.
* Update the `Overview` docs to add the `Service Hierarchy Relationship` section.
* Fix incorrect words for `backend-bookkeeper-monitoring.md` and `backend-pulsar-monitoring.md`
+* Document a new way to load balance OAP.
All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/202?closed=1)
diff --git a/docs/en/setup/backend/backend-load-balancer.md b/docs/en/setup/backend/backend-load-balancer.md
index 6436326808..4773bb47dc 100644
--- a/docs/en/setup/backend/backend-load-balancer.md
+++ b/docs/en/setup/backend/backend-load-balancer.md
@@ -1,7 +1,13 @@
# Backend Load Balancer
-When setting the Agent or Envoy to connect to the OAP server directly as in default, the OAP server cluster would face the problem
-of load imbalance. This issue would be severe in high-traffic load scenarios. [SkyWalking Satellite](https://github.com/apache/skywalking-satellite) is recommended to be
+When setting the Agent or Envoy to connect to the OAP server directly by default,
+the OAP server cluster would face the problem of load imbalance. This issue
+becomes severe in high-traffic load scenarios. In this doc, we will introduce
+two means to solve the problem.
+
+## SkyWalking Satellite Project
+
+[SkyWalking Satellite](https://github.com/apache/skywalking-satellite) is recommended to be
used as a native gateway proxy to provide load balancing capabilities for data content before the data from Agent/ Envoy
reaches the OAP. The major difference between Satellite and other general wide used proxy(s), like Envoy, is that it would route the data accordingly to contents rather than connection, as gRPC streaming is used widely in SkyWalking.
@@ -9,4 +15,63 @@ Follow instructions in the [Setup SkyWalking Satellite](https://skywalking.apach
to deploy Satellite and connect your application to the Satellite.
[Scaling with Apache SkyWalking](https://skywalking.apache.org/blog/2022-01-24-scaling-with-apache-skywalking/) blog
-introduces the theory and technology details on how to set up a load balancer for the OAP cluster.
\ No newline at end of file
+introduces the theory and technology details on how to set up a load balancer for the OAP cluster.
+
+## Envoy Filter to Limit Connections Per OAP Instance
+
+If you don't want to deploy skywalking-satellite, you can enable Istio sidecar
+injection for SkyWalking OAP Pods,
+
+```shell
+kubectl label namespace $SKYWALKING_NAMESPACE istio-injection=enabled
+kubectl -n $SKYWALKING_NAMESPACE rollout restart -l app=skywalking,component=oap
+```
+
+and apply an EnvoyFilter to limit the connections per OAP instance, so that
+each of the OAP instance can have similar amount of gRPC connections.
+
+Before that, you need to calculate the number of connections for each OAP
+instance as follows:
+
+```
+NUMBER_OF_SERVICE_PODS=<the-number-of-service-pods-that-are-monitored-by-skywalking>
+
+# Each service Pod has 2 connections to OAP
+NUMBER_OF_TOTAL_CONNECTIONS=$((NUMBER_OF_SERVICE_PODS * 2))
+
+# Divide the total connections by the replicas of OAP
+NUMBER_OF_CONNECTIONS_PER_OAP=$((NUMBER_OF_TOTAL_CONNECTIONS / $NUMBER_OF_OAP_REPLICAS))
+```
+
+And you can apply an EnvoyFilter to limit connections:
+
+```shell
+kubectl -n $SKYWALKING_NAMESPACE apply -f - <<EOF
+apiVersion: networking.istio.io/v1alpha3
+kind: EnvoyFilter
+metadata:
+ name: oap-limit-connections
+ namespace: istio-system
+spec:
+ configPatches:
+ - applyTo: NETWORK_FILTER
+ match:
+ context: ANY
+ listener:
+ filterChain:
+ filter:
+ name: envoy.filters.network.http_connection_manager
+ portNumber: 11800
+ patch:
+ operation: INSERT_BEFORE
+ value:
+ name: envoy.filters.network.ConnectionLimit
+ typed_config:
+ '@type': type.googleapis.com/envoy.extensions.filters.network.connection_limit.v3.ConnectionLimit
+ max_connections: $NUMBER_OF_CONNECTIONS_PER_OAP
+ stat_prefix: envoy_filters_network_connection_limit
+ workloadSelector:
+ labels:
+ app: oap
+EOF
+```
diff --git a/docs/menu.yml b/docs/menu.yml
index d88ad1cdbf..02fe826fd3 100644
--- a/docs/menu.yml
+++ b/docs/menu.yml
@@ -84,7 +84,7 @@ catalog:
path: "/en/setup/backend/dynamical-logging"
- name: "Security(SSL/TLS/mTLS)"
path: "/en/setup/backend/grpc-security"
- - name: "Setup Native Load Balancer"
+ - name: "Setup Load Balancer"
path: "/en/setup/backend/backend-load-balancer"
- name: "OAP Self Observability Telemetry"
path: "/en/setup/backend/backend-telemetry"