云计算

octavia haproxy 应用机制分析

2022-03-24  本文已影响0人  cloudFans

首先默认haproxy 一般是不会利用多核的

  1. 1C1G的haproxy 实例

  2. 8C16G的haproxy 实例

image.png

第一点,最大连接数,以及最大sock 会基于cpu 累积

1. 基于实际配置确认

1C1G的haproxy 实例

image.png

8C16G的haproxy 实例


image.png

2. 基于haproxy 模板确认



$ pwd

octavia/octavia/common/jinja/haproxy


$ grep -C 3 maxconn -r *
combined_listeners/templates/base.j2-    log {{ log_server | default('/run/rsyslog/octavia/log', true)}} local{{ administrative_log_facility }} notice
combined_listeners/templates/base.j2-    stats socket {{ sock_path }} mode 0666 level user
combined_listeners/templates/base.j2-    {% if loadbalancer.global_connection_limit is defined %}
combined_listeners/templates/base.j2:    maxconn {{ loadbalancer.global_connection_limit }}
combined_listeners/templates/base.j2-    {% endif %}
combined_listeners/templates/base.j2-    {% set found_ns = namespace(found=false) %}
combined_listeners/templates/base.j2-    {% for listener in loadbalancer.listeners if listener.enabled %}
--
combined_listeners/templates/macros.j2-{% macro frontend_macro(constants, lib_consts, listener, lb_vip_address) %}
combined_listeners/templates/macros.j2-frontend {{ listener.id }}
combined_listeners/templates/macros.j2-    {% if listener.connection_limit is defined %}
combined_listeners/templates/macros.j2:    maxconn {{ listener.connection_limit }}
combined_listeners/templates/macros.j2-    {% endif %}
combined_listeners/templates/macros.j2-    {% if (listener.protocol.lower() ==
combined_listeners/templates/macros.j2-       constants.PROTOCOL_TERMINATED_HTTPS.lower()) %}
--
split_listeners/templates/base.j2-    log {{ log_server | default('/run/rsyslog/octavia/log', true)}} local{{ administrative_log_facility }} notice
split_listeners/templates/base.j2-    stats socket {{ sock_path }} mode 0666 level user
split_listeners/templates/base.j2-    {% if loadbalancer.global_connection_limit is defined %}
split_listeners/templates/base.j2:    maxconn {{ loadbalancer.global_connection_limit }}
split_listeners/templates/base.j2-    {% endif %}
split_listeners/templates/base.j2-    {% set found_ns = namespace(found=false) %}
split_listeners/templates/base.j2-    {% for pool in loadbalancer.listener.pools if pool.enabled %}
--
split_listeners/templates/macros.j2-{% macro frontend_macro(constants, listener, lb_vip_address) %}
split_listeners/templates/macros.j2-frontend {{ listener.id }}
split_listeners/templates/macros.j2-    {% if listener.connection_limit is defined %}
split_listeners/templates/macros.j2:    maxconn {{ listener.connection_limit }}
split_listeners/templates/macros.j2-    {% endif %}
split_listeners/templates/macros.j2-    {% if (listener.protocol.lower() ==
split_listeners/templates/macros.j2-       constants.PROTOCOL_TERMINATED_HTTPS.lower()) %}

octavia/octavia/common/jinja/haproxy (dev/victoria)


# 只有两个配置项



 maxconn {{ listener.connection_limit }}
 maxconn {{ loadbalancer.global_connection_limit }}

# 问题 应该就是这两个配置项不一致,调成一致即可,上限1000k即可




在1000k一下修改一下默认连接数配置 即可

(py3env) [root@control01 ~]# diff /etc/kolla/octavia-worker/octavia.conf /etc/kolla/octavia-worker/octavia.conf-bak
21c21
< default_connection_limit = 500000
---
> default_connection_limit = 5000000


确认实际配置生效

image.png image.png
上一篇下一篇

猜你喜欢

热点阅读