4.15.2 How to set directives
- Organization of this subsection
(1) Transferring WebSocket communication
Each address is as follows:
Web server: www.example.com
Backend server: backend.example.com
Specify the forwarding destination URL in the ProxyPass directive by using the format containing ws://host-name[:port-number]/. If you specify the ProxyPass directive as shown below, the ws://www.example.com/ws/ request from the client will be changed to the ws://backend.example.com/ request and then forwarded to the backend server.
ProxyPass /ws/ ws://backend.example.com/
(2) WebSocket log
For details on the WebSocket log, see (5) WebSocket log in 4.2.2 How to collect logs.
(3) Changing the upper limit for the number of server threads
During WebSocket communication, a server process or thread is occupied until the connection with the client or backend server is disconnected. Therefore, you must keep running many server threads compared to when WebSocket is not used.
(a) For the UNIX version
Using WebSocket requires many server threads. Therefore, we recommend that you use the worker MPM. Use the ThreadsPerChild and ThreadLimit directives to specify the number of server threads that can run in a server process for the worker MPM. Use the ServerLimit directive to specify the upper limit for the number of server processes. Use the MaxClients directive to specify the maximum number of server threads.
(b) For the Windows version
Use the ThreadsPerChild and ThreadLimit directives to specify the number of server threads that can run.