简体   繁体   English

Apache为每个WebSocket连接保持一个活动的工作程序

[英]Apache keeps an active worker for each WebSocket connection

Having Apache (2.4.29) configured as reverse proxy for WebSocket requests with mod-proxy-wstunnel : 使用mod-proxy-wstunnel Apache(2.4.29)配置为WebSocket请求的反向代理:

ProxyPass "/myapp/ws" "ws://localhost:8080/myapp/ws"

For each active WebSocket client, I see an Apache worker that remains active (in "Sending Reply" status) as long as this client is kept alive even if there is no data being sent. 对于每个活动的WebSocket客户端,即使没有发送任何数据,只要该客户端保持活动状态,我都会看到一个Apache工作进程保持活动状态(“发送回复”状态)。 In practice it means I cannot scale WebSocket clients because all available connections are consumed. 实际上,这意味着我无法扩展WebSocket客户端,因为消耗了所有可用的连接。

In /server-status there is one line like this for each client: 在/ server-status中,每个客户端都有一行这样的内容:

Srv PID Acc M   CPU SS  Req Conn    Child   Slot    Client  Protocol    VHost   Request
0-0 10219   0/43/43 _   1.04    1828    984237  0.0 0.09    0.09    ::1 http/1.1    butler.openbravo.com:443    GET /myapp/ws/helloWs HTTP/1.1

Using different mpm configurations (tested with event, worker and prefork) has no effect on this. 使用不同的mpm配置(经过事件,工作程序和prefork测试)对此没有影响。

I would need Apache to be able to reuse these workers when they are sitting idle (no transferring any data) in order to be able to scale it. 我需要Apache能够在这些工人闲置(不传输任何数据)时重用它们,以便对其进行扩展。 Is it possible? 可能吗?

No, it's not currently possible to multiplex websockets connections this way. 不,目前无法以这种方式多路复用websockets连接。

In httpd trunk (2.5.x) there are experimental options to allow these connections to go asynchronous after idle for some time. 在httpd主干(2.5.x)中,有实验性的选项可让这些连接在空闲一段时间后变为异步状态。 But it is unlikely to be something that would be backported to 2.4.x and there is not really a stable 2.6.x on the horizon at the moment. 但是不太可能会被移植到2.4.x,并且目前还没有稳定的2.6.x。

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

相关问题 Ratchet Websocket Apache2 SSL 无法连接到 PHP websocket - Ratchet Websocket Apache2 SSL unable to make connection to PHP websocket apache活动MQ连接池的有效方法 - Efficient way of apache active MQ connection pooling Apache Websocket连接:升级由保持活动状态替换 - Apache websocket connection:upgrade replaced by keep-alive Apache + Socket.io导致在Mac上建立Websocket连接时出错 - Apache + Socket.io result in error establishing websocket connection on Mac 当Apache HTTPD在Tomcat前面时,WebSocket连接中断 - WebSocket connection interrupted when Apache HTTPD in front of Tomcat Node.js和Apache生成的网页之间的WebSocket连接 - WebSocket connection betwen node.js and webpage generated by Apache 使用Apache和Socket.io的代理WebSocket连接 - Proxy WebSocket connection using Apache & Socket.io Apache 代理后面的 Docker 映像中的 TeamCity 服务器 WebSocket 连接错误 - TeamCity server WebSocket connection error in Docker image behind Apache proxy Linux + Apache来检测每个虚拟主机的连接计数? - Linux + Apache to detect the Connection Counts of each Vhosts? 如何测量每个活动的Apache连接的内存使用情况? - How to measure the memory usage per active Apache Connection?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM