I have an Apache 2.4.23 configuration with mod_proxy/mod_proxy_balancer/mod_slotmem_shm/mod_lbmethod_byrequests enabled.
Furthermore, I have multiple VirtualHost listening on different ports with a setup like this (PORT and COMPONENT are unique):
Listen PORT
<VirtualHost *:PORT>
Include "eib/conf/default-proxy-params"
ErrorLog "logs/PORT-COMPONENT-error.log"
CustomLog "logs/PORT-COMPONENT-access.log" common
<Proxy balancer://COMPONENT/>
BalancerMember https://HOST1:PORT
BalancerMember https://HOST2:PORT
ProxySet lbmethod=byrequests
</Proxy>
ProxyPass / balancer://COMPONENT/ lbmethod=byrequests nofailover=Off maxattempts=3
ProxyPassReverse / balancer://COMPONENT/
</VirtualHost>
When I have only one VirtualHost entry in my config, everything works fine. As soon as I add an another VirtualHost, Apache crashes with a configuration failed error:
[Wed Oct 12 21:59:38.211829 2016] [slotmem_shm:error] [pid 4129010:tid 1] (24)Too many open files: AH02611: create: apr_shm_create(/apache/logs/slotmem-shm-pf3f0916c.shm) failed
[Wed Oct 12 21:59:38.211927 2016] [:emerg] [pid 4129010:tid 1] AH00020: Configuration Failed, exiting
I have checked that ulimit is set to unlimited for number of files, so this can not be the problem. It seems that there is a collision between slotmem files created for BalancerMemebers.
When I start with one single VirtualHost only, everything will work as expected and I get the following slotmem files created:
slotmem-shm-p99964586.shm
slotmem-shm-p99964586_COMPONENT.shm
One seems to be unique (_COMPONENT) for the virtual host, but the second one looks like it could cause name collisions.
Does someone have an idea how to solve this problem?