Re: [I] help request: Upstream weight allocation is incorrect [apisix]
Baoyuantop closed issue #12230: help request: Upstream weight allocation is incorrect URL: https://github.com/apache/apisix/issues/12230 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
renshunhang commented on issue #12230: URL: https://github.com/apache/apisix/issues/12230#issuecomment-2921323742 > > plugin safe-check-forward association upstream, so may be remove plugin and try again ? or check plugin safe-check-forward whether flow control about upstream ? > > [@renshunhang](https://github.com/renshunhang), Is it possible to try it this way? Does the problem still exist? The issue has been resolved. I checked the traffic distribution in APISIX, which seems to reuse the functionality of OpenResty. After looking at the OpenResty source code, I found that when setting weights, some operations are performed based on the greatest common divisor of the weights. If the allocated weight is a prime ratio like 67:33, it seems that a large number of calls are needed to approach this ratio. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
Baoyuantop commented on issue #12230: URL: https://github.com/apache/apisix/issues/12230#issuecomment-2911020932 > plugin safe-check-forward association upstream, so may be remove plugin and try again ? or check plugin safe-check-forward whether flow control about upstream ? @renshunhang, Is it possible to try it this way? Does the problem still exist? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
hanqingwu commented on issue #12230: URL: https://github.com/apache/apisix/issues/12230#issuecomment-2896874025 plugin safe-check-forward association upstream, so may be remove plugin and try again ? or check plugin safe-check-forward whether flow control about upstream ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
renshunhang commented on issue #12230: URL: https://github.com/apache/apisix/issues/12230#issuecomment-2893085531 > Need to describe what version you are using? How it was deployed and the corresponding config file. Additionally, I found a problem. 172.31.1.1:31684 is the address of the APISIX gateway, while https://uat.other.pm/ is the address of Nginx. When requests are forwarded to the APISIX gateway, there are no issues with weight distribution when I call directly from the APISIX gateway. However, when calling from this domain name, the weight distribution is incorrect. What could be the problem? My Nginx only performs a single layer of forwarding. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
renshunhang commented on issue #12230: URL: https://github.com/apache/apisix/issues/12230#issuecomment-2892787136 > Need to describe what version you are using? How it was deployed and the corresponding config file. Version is 3.11.0, and I deploy it with K8S, the config is : kind: ConfigMap apiVersion: v1 metadata: name: apisix namespace: apisix data: config.yaml: >- plugins: - openai-token-collector - safe-check-forward - prometheus - loki-logger - public-api - server-info - cors - limit-conn - limit-req - limit-count - proxy-rewrite - redirect - real-ip apisix: node_listen: 9080 # APISIX listening port enable_ipv6: false enable_control: true enable_admin_cors: true control: ip: "0.0.0.0" port: 9092 nginx_config: http_configuration_snippet: | client_header_buffer_size 4m; large_client_header_buffers 4 4m; proxy_buffer_size 256k; proxy_buffers 4 512k; proxy_busy_buffers_size 512k; deployment: admin: allow_admin: # https://nginx.org/en/docs/http/ngx_http_access_module.html#allow - 0.0.0.0/0 # We need to restrict ip access rules for security. 0.0.0.0/0 is for test. admin_key: - name: "admin" key: edd1c9f034335f136f87ad84b625c222 role: admin # admin: manage all configuration data - name: "viewer" key: 4054f7cf07e344346cd3f287985e7333 role: viewer etcd: host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster. - "http://apisix-etcd.apisix.svc.cluster.local:2379"; prefix: "/apisix" # apisix configurations prefix timeout: 30 # 30 seconds plugin_attr: prometheus: export_addr: ip: "0.0.0.0" port: 9091 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
renshunhang commented on issue #12230:
URL: https://github.com/apache/apisix/issues/12230#issuecomment-2892759424
> Need to describe what version you are using? How it was deployed and the
corresponding config file.
The version is 3.11.0, I deploy it with k8s, and config file:
kind: Deployment
apiVersion: apps/v1
metadata:
name: apisix
namespace: apisix
labels:
app.kubernetes.io/instance: apisix
app.kubernetes.io/name: apisix
app.kubernetes.io/version: 2.10.0
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/instance: apisix
app.kubernetes.io/name: apisix
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: apisix
app.kubernetes.io/name: apisix
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: apisix
app.kubernetes.io/name: apisix
topologyKey: kubernetes.io/hostname
weight: 1
volumes:
- name: apisix-config
configMap:
name: apisix
defaultMode: 420
initContainers:
- name: wait-etcd
image: ${BUSYBOX_IMAGE_URL}
command:
- sh
- '-c'
- >-
until nc -z apisix-etcd.apisix.svc.cluster.local 2379; do echo
waiting for etcd `date`; sleep 2; done;
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: Always
containers:
- name: apisix
image: ${APISIX_IMAGE_URL}
ports:
- name: http
containerPort: 9080
protocol: TCP
- name: tls
containerPort: 9443
protocol: TCP
- name: admin
containerPort: 9180
protocol: TCP
resources: {}
volumeMounts:
- name: apisix-config
mountPath: /usr/local/apisix/conf/config.yaml
subPath: config.yaml
readinessProbe:
tcpSocket:
port: 9080
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 6
lifecycle:
preStop:
exec:
command:
- /bin/sh
- '-c'
- sleep 30
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
revisionHistoryLimit: 10
progressDeadlineSeconds: 600
---
kind: ConfigMap
apiVersion: v1
metadata:
name: apisix
namespace: apisix
data:
config.yaml: >-
plugins:
- openai-token-collector
- safe-check-forward
- prometheus
- loki-logger
- public-api
- server-info
- cors
- limit-conn
- limit-req
- limit-count
- proxy-rewrite
- redirect
- real-ip
- client-control
- proxy-control
- request-id
- zipkin
- ext-plugin-pre-req
- fault-injection
- mocking
- serverless-pre-function
- ip-restriction
- ua-restriction
- referer-restriction
- csrf
- uri-blocker
- request-validation
- chaitin-waf
- multi-auth
- openid-connect
- cas-auth
- authz-casbin
- authz-casdoor
- wolf-rbac
- ldap-auth
- hmac-auth
- basic-auth
- jwt-auth
- jwe-decrypt
- key-auth
- consumer-restriction
- attach-consumer-label
- forward-auth
- opa
- authz-keycloak
- proxy-cache
- workflow
- api-breaker
- gzip
- traffic-split
- response-rewrite
- degraphql
- kafka-proxy
- grpc-transcode
- grpc-web
- http-dubbo
- datadog
- elasticsearch-logger
- echo
- loggly
- http-logger
- splunk-he
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
renshunhang commented on issue #12230:
URL: https://github.com/apache/apisix/issues/12230#issuecomment-2892644008
> Please provide the minimum reproducible steps.
upstream:
{"nodes":[{"host":"172.31.192.1","port":32383,"weight":66},{"host":"172.31.192.1","port":32384,"weight":34}],"retries":2,"type":"roundrobin","checks":{"active":{"concurrency":10,"healthy":{"http_statuses":[200,302],"interval":5,"successes":1},"http_path":"/kunlun/ingress/api/sg/health-check","https_verify_certificate":true,"timeout":10,"type":"http","unhealthy":{"http_failures":3,"http_statuses":[500,404,503,501,502],"interval":1,"tcp_failures":2,"timeouts":3}},"passive":{"healthy":{"http_statuses":[200,201,302],"successes":1},"type":"http","unhealthy":{"http_failures":3,"http_statuses":[500,404,503,501,502],"tcp_failures":2,"timeouts":7}}},"hash_on":"vars","scheme":"http","pass_host":"pass","name":"sg-158a331b4Iavh47d"}
route: (safe-check-forward is custom plugin, will use this upstream:
sg-158a331b4Iavh47d)
{"uri":"/kunlun/ingress/api/sg-2/87c2743baa81475c9a0b54ecb0b902cd/group_generate_stream/*","name":"sg-158a331b4Iavh47d","desc":"服务群组转发路由","plugins":{"loki-logger":{"_meta":{"filter":[["http_req_safe_checked","==","false"]]},"batch_max_size":100,"buffer_duration":60,"endpoint_addrs":["https://uatpm.other.cn"],"endpoint_uri":"/loki/api/v1/push","inactive_timeout":5,"include_req_body":false,"include_resp_body":false,"keepalive":true,"keepalive_pool":5,"keepalive_timeout":6,"log_format":{"appcode_id":"$appcode_id","completion_tokens":"$completion_tokens","issuer":"$issuer","prompt_tokens":"$prompt_tokens","request_url":"$request_url","service_name":"$service_name","src":"$src"},"log_labels":{"job":"apisix"},"max_retry_count":0,"name":"loki-logger","retry_delay":1,"ssl_verify":false,"tenant_id":"fake","timeout":3000},"safe-check-forward":{"name":"safe-check-forward","safe_check":false,"serving_upstream":"sg-158a331b4Iavh47d"}},"status":1}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
Baoyuantop commented on issue #12230: URL: https://github.com/apache/apisix/issues/12230#issuecomment-2892658036 Need to describe what version you are using? How it was deployed and the corresponding config file. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [I] help request: Upstream weight allocation is incorrect [apisix]
Baoyuantop commented on issue #12230: URL: https://github.com/apache/apisix/issues/12230#issuecomment-2890419819 Please provide the minimum reproducible steps. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
