我试图devise一个体系结构来处理大量的TCP套接字连接,我对这个架构的限制有所怀疑。 我将不得不处理大约20k个并发 TCP连接,这些连接是长连接的,它们将长时间保持连接状态,并且会每分钟发送一次数据。 使用线程是没有问题的,因为20k线程会使系统资源不足。 我打算使用gevent来处理这种并发连接数量,甚至使用haproxy和2个服务器(w / gevent)来处理每个10k连接。 这有道理吗? 有没有人有一些build议,或有一些使用10K +连接gevent的经验? 有没有人有处理这些连接的硬件要求的想法? 我看到了一些基准testing ,显示了5k并发连接上gevent的连接超时问题,对于我的问题来说这不是很有希望。 注意 :我已经阅读了关于C10k问题和“百万用户彗星应用程序”上的build议。
我试图build立一个testinghaproxy服务器,将涵盖2个基本领域。 如果用户正在使用http,但只有在特定的uri部分不存在的情况下才能自动redirect到https。 例如,如果用户访问http://www.test.com,他们将被redirect到https://www.test.com 。 但是,如果用户转到https://www.test.com/blog或http://www.test.com/blog,他们将被redirect到http://www.test.com/blog 。 这是我目前的testinghaproxy.cfg。 我正在运行haproxy 1.5-dev17 任何帮助,这是非常感谢。 global log 127.0.0.1 local0 log 127.0.0.1 local1 notice maxconn 15000 user haproxy group haproxy defaults log global mode http option httplog option dontlognull option abortonclose option http-server-close option redispatch retries 3 timeout queue 600s timeout connect 9s timeout client 60s timeout server 60s balance roundrobin […]
我的haproxy.cfg文件有一个使用主机名的后端服务器: backend servers server myapp ${PORTAL_PORT_3000_TCP_ADDR}:${PORTAL_PORT_3000_TCP_PORT} maxconn 32 myapp正在运行在链接到haproxy docker容器的其他docker容器中。 提到的环境variables在haproxy容器中有值,但是当容器开始引发这个错误 [ALERT] 244/134924 (8) : parsing [/etc/haproxy.cfg:16] : Unknown host in '${PORTAL_PORT_3000_TCP_ADDR}:${PORTAL_PORT_3000_TCP_PORT}' [ALERT] 244/134924 (8) : Error(s) found in configuration file : /etc/haproxy.cfg [ALERT] 244/134934 (8) : Fatal errors found in configuration.
我有一个HAProxy服务器的问题。 我想在头部转发一个客户端IP。 我几乎做到了,但是有一个有趣的案例,我无法弄清楚。 我需要在X-CLIENT-IP和X-FORWARDED-FOR标签中的头2个地方编写客户端IP。 问题是:当我使用 option http-server-close option forwardfor 在目标服务器上,我看到头X-FORWARDED-FOR = xxx.xxx.xxx.xxx(客户端IP),但没有x-client-ip头。 当我使用: option forwardfor header X-Client-IP option http-server-close 在目标服务器上,我看到头X-CLIENT-IP = xxx.xxx.xxx(客户端IP),但是X-FORWARDED-FOR = xxx.xxx.xxx.xxx(HAProxy ip) 我需要在目标标题上看到X-CLIENT-IP和X-FORWARDED-FOR具有客户端IP的值。 我尝试混合configuration option forwardfor option forwardfor header X-Client-IP option http-server-close 没有效果。 我也不能安装任何模块。 目标是IIS。 有任何想法吗? 🙁
我只是接pipe了一个新环境的pipe理。 一个已知的问题是环境以高响应时间(20+秒)着称,所以我想我会打开haproxy日志logging,看看发生了什么事情。 我想我会看到在应用程序服务器的加载时间很慢,但我实际上在HAProxy中看到了很高的Tq值。 HAProxy在EC2上,并不落后于ELB。 Sep 5 14:22:00 haproxy-apps01 haproxy[24695]: 76.14.153.221:3371 [05/Sep/2012:14:21:49.780] http-in default_apps/fe04-c 10936/0/0/55/10991 200 488 – – —- 111/111/0/1/0 0/0 "GET /event_times/next?callback=jQuery170189312373075111_1346854917562&_=1346854918453 HTTP/1.1" 正如你所看到的,这个有一个约10秒的Tq。 并不是所有的Tq都很高(1+秒),但是其中很大一部分(约35%)。 通常情况下,当我看到这种行为,我希望有networking问题,但这是一个这样的问题,这是一个非常高的访客百分比,所以我想知道是否有人看到这个或有任何暗示诊断如果问题可能在这个盒子上?
在Ubuntu 14.04上使用haproxy版本1.4.24 我想使用haproxy来重写和redirect不再有效的新的等效url。 我已经使用haproxy作为反向代理和负载均衡器。 我有重写工作正常,但是当我尝试redirect我最终没有redirect或在redirect循环。 我读了几个地方,这个技术是重写和redirect的前缀在前端的URL,但我没有任何运气。 任何帮助,将不胜感激。 谢谢。 global log 127.0.0.1 local0 log 127.0.0.1 local1 notice maxconn 4096 user haproxy group haproxy spread-checks 0 defaults log global mode http option httplog option dontlognull retries 3 timeout queue 20000 timeout client 50000 timeout connect 5000 timeout server 50000 frontend haproxy-0-80 bind 0.0.0.0:80 default_backend haproxy_service acl old_url […]
我有两个网站HAProxy,其中一个公共和一个私人。 www.mysite.com private.mysite.com Atm,我使用haproxy这样的: frontend mysite_https bind *.443 ssl crt /etc/mycert.pem ca-file /etc/myca.pem verify optional no-sslv3 mode http acl domain_www hdr_beg(host) -i www. acl domain_private hdr_beg(host) -i private. acl path_ghost path_beg /ghost/ acl clientcert ssl_c_used redirect location https://www.example.com if path_ghost !clientcert redirect location https://www.example.com if !domain_www !clientcert use_backend bknd_private if domain_private use_backend bknd_www if domain_www […]
我怎么能在haproxy(1.5dev19)中使用ACL规则对于每个拥有自己的ssl证书的服务器多个主机? 我有3个后端与多个域都在一个IP地址。 nodejs(http / https / ws / wss) nginx(http / https)(现在apache的反向代理) apache(http) 我想把haproxy摆在他们面前,并使其服务ssl连接。 haproxy acl有可能吗?或者我必须在haproxy之前使用类似stud的东西? 就像是: frontend http-in bind *:80 acl host_domain1 hdr(host) -i domain1.lt use_backend nginx_web_http if host_domain1 frontend http-in bind *:443 acl host_domain1 hdr(host) -i domain1.lt use_backend nginx_web_https if host_domain1 backend nginx_web_https mode http ssl crt /etc/ssl/domain1/ crt ./certs/ prefer-server-cipher option httplog […]
问题 我正在使用haproxy来负载均衡Web服务器。 我使用会话持久性与其他cookie作为一些应用程序使用会话文件,这些服务器之间不同步。 我想要禁用服务器进行维护,但不会中断会话。 所以我想让现有的客户端继续他们的应用程序会话,但不接受新的客户端。 haproxy的行为 我将服务器设置为“正在维护” 如果客户端设置了cookie,即使标记为“正在维护” 如果一个新的客户端(没有cookie)来,它被引导到另一个服务器 毕竟所有的客户端都结束了他们的应用程序会话,没有更多的客户端将cookie设置到这个特定的服务器上,我会很好地closures它,而不会中断用户。 你认为这是可以实现一些haproxyconfiguration? 还是有一个聪明的方法来做到这一点? 其他方法 非穷举的其他方法来实现这一需求: 在服务器之间同步会话文件(需要一种在多个服务器之间同步文件的方法,或者一个普通的单个安装点) 使用数据库来存储会话信息(需要改变应用程序行为) 更多细节 我使用这种configuration: frontend https-in bind xxx.xxx.xxx.xxx:443 ssl crt /etc/haproxy/ssl/_default.pem crt /etc/haproxy/ssl reqadd X-Forwarded-Proto:\ https acl APP1 hdr(host) -i APP1.atac.local use_backend APP1 if APP1 default_backend _default backend APP1 redirect scheme https if !{ ssl_fc } mode http balance roundrobin cookie […]
我需要用两个不同的SSL证书来configurationHAProxy www.example.com api.example.com 现在我从serverfault( 在Haproxy中configuration多个SSL证书 )的post中学习了如何使用2个证书,但是服务器继续使用两个域中提到的第一个证书。 configuration: frontend apache-https bind 192.168.56.150:443 ssl crt /certs/crt1.pem crt /certs/cert2.pem reqadd X-Forwarded-Proto:\ https default_backend apache-http backend apache-http redirect scheme https if { hdr(Host) -i www.example.com } !{ ssl_fc } redirect scheme https if { hdr(Host) -i api.example.com } !{ ssl_fc } … 如何根据URL告诉HAProxy使用哪个证书? 完整configuration: global log /dev/log local0 log […]