ru Русский

Reticularium

NETWORKS PLACE

This doesn’t harm in most cases, but still is worth keeping in mind that if you have a 256MB VPS, it is a 1/128 of the 32 GB server and thus its network bandwidth is usually limited to 1/128 of 1 Gigabit which equals 1 MB/sec.

Various gateway servers, balancers, caching proxies don’t need CPU power and RAM, so small 256MB VPS choice looks natural. This is where the problem may arise.

For some reason the example below taken from Apache documentation didn’t work for me

1
2
3
4
5
<Proxy balancer://mycluster>
BalancerMember http://192.168.1.50:80
BalancerMember http://192.168.1.51:80
</Proxy>
ProxyPass /test balancer://mycluster

That is, it did work, but mod_dir was adding trailing slashes to both host and path, like this: http://www.example.com/mypath --> http://www.example.com//mypath/ if it found mypath to be a directory of course.

Well, perhaps there is some reason for this that I couldn’t find, but the working solution I found is to add slashes to BalancerMember declarations, like so:

1
2
3
4
5
<Proxy balancer://mycluster>
BalancerMember http://192.168.1.50:80/
BalancerMember http://192.168.1.51:80/
</Proxy>
ProxyPass /test balancer://mycluster

UPDATE

This needs an additional investigation, it seems that this may affect other things, namely PHP $_SERVER variables may get messed up. This doesn’t necessarily mean this solution is wrong, but it requires a deeper look.

The better solution is to use Nginx as a proxy balancer anyway :)