简体   繁体   English

Apache HTTP服务器负载均衡器

[英]Apache http server load balancer

I configured apache http server to act as load balancer using mod-proxy module but when i run 50 concurrent user the load is not distributing equally. 我使用ap-proxy模块将apache http服务器配置为充当负载平衡器,但是当我运行50个并发用户时,负载分布不均。 All requests are going to eigher server 1 or server 2. 所有请求都将发送到eigher服务器1或服务器2。

Is there any way to monitor the load balancer or distribute the load equally? 有什么方法可以监视负载均衡器或平均分配负载?

    ProxyRequests off
    Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

    <Proxy balancer://executeeditchecks>

        BalancerMember http://172.50.3.6:9038/executeeditchecks route=server-044
        BalancerMember http://172.50.3.3:9038/executeeditchecks route=server-003
        ProxySet lbmethod=byrequests
        ProxySet stickysession=ROUTEID
    </Proxy>

    <Proxy balancer://editcheckexecution>

        BalancerMember http://172.50.3.6:9038/editcheckexecution route=server-044
        BalancerMember http://172.50.3.3:9038/editcheckexecution route=server-003
        ProxySet lbmethod=byrequests
        ProxySet stickysession=ROUTEID
    </Proxy>

    Listen 7070
    <VirtualHost *:7070>

    ProxyPass /executeeditchecks balancer://executeeditchecks/
    ProxyPassReverse /executeeditchecks balancer://executeeditchecks/

    ProxyPass /editcheckexecution balancer://editcheckexecution/
    ProxyPassReverse /editcheckexecution balancer://editcheckexecution/

    </VirtualHost>

You can see more details about the balancer by using the balancer manager . 您可以使用平衡器管理器查看有关平衡器的更多详细信息。

see " Enabling Balancer Manager Support " at https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html 请参阅https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html上的启用Balancer Manager支持

by adding 通过增加

<Location "/balancer-manager">
    SetHandler balancer-manager
</Location>

Don't forget to set access restrictions to that url, as it is also possible to disable a worker there. 不要忘记为该URL设置访问限制,因为也可以在那里禁用工作程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM