Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run apache2 on Ubuntu as a caching load-balancing reverse proxy in front of a group of application servers. I have noticed that the balancer maintains some state for some of the attributes visible in /balancer-manager such as whether an IP is enabled/disabled, load factor, etc.

My site has periods of high (and low) usage, and recently as I added a new server to the working group I noticed that the load balancer picked up the new server but had it set to Disabled. I'm curious where that data is stored, and/or how it is initialized.

Balancer config (names changed to protect the innocent:

SSLProxyEngine On
<Proxy balancer://main>
    BalancerMember https://10.10.1.1
    BalancerMember https://10.10.1.2
    BalancerMember https://10.10.1.3
</Proxy>

ProxyRequests Off
ProxyPass /balancer-manager !
ProxyPass /  balancer://main/
ProxyPassReverse /  balancer://main/

UPDATE: code spelunking shows the balancer status stored in-memory only in v2.2.0 as the struct ap_scoreboard and reinitialized on startup. There's no way the thing I think I'm seeing is happening. Kudos to @ShaneMadden for the insights into v2.4.

share|improve this question
    
Do you mean that changes that are made via the balancer manager (and not in the config files) are persisting across restarts of the apache service? –  Shane Madden Sep 17 '12 at 20:04
    
So it would seem. It is unclear what Enabled state will be when I add a server IP into the rotation, if that server was once a part of the balancer group. –  khoxsey Sep 17 '12 at 20:07
    
@ShaneMadden Persistence of managed balancer-manager state is a new feature in Apache 2.4. –  EJP Sep 17 '12 at 21:33
    
@EJP So it is, I had missed that one! The changes doc says "can be persistent", but I'm not seeing any directive that governs whether persistence is used? –  Shane Madden Sep 17 '12 at 21:34

1 Answer 1

up vote 1 down vote accepted

This feature seems to be a bit of a mess.. the idea seems to be to use mod_slotmem_shm to persist balancer configs, which has an option to make its storage persistent.

To that end, the .shm files in your logs directory (location does not seem to be configurable) are where the configurations are stored, which seems to only happen on 2.4.2 and later. The file will be named slotmem-shm-<identifier>_balancername.shm for a balancer defined as <Proxy balancer://balancername>, for example.

However, in my testing the .shm file isn't created at all in 2.4.1, and doesn't persist through a service restart in 2.4.2 and 2.4.3. Can you clarify what conditions you have that are causing persistence - what modules are in use, what config, etc? Are the .shm files staying put when the service is stopped?

It looks like a change was committed today to do some logging relating to persistence. I tried to compile trunk to test out whether that would help clarify what's going on, and couldn't compile due to errors related to slotmem (go figure).

share|improve this answer
    
Running v2.2.20 (Ubuntu), so not using the new features in 2.4, and not loading the slotmem module. The issue seems to persist beyond just reboots; the LB/RP runs in Amazon EC2 and the "remembered state" exists in my stored AMI. It may be time for me to do some code spelunking, as I am curious where the init values come from if you don't provide them in proxy_balancer.conf. –  khoxsey Sep 18 '12 at 16:32
    
@khoxsey Hmm.. there shouldn't be any state storage, then - I wonder if something else strange is at work. What's the config for your balancer look like? –  Shane Madden Sep 18 '12 at 18:25
    
Agreed about the state storage, I was surprised the first time I noticed it, and more curious each time it happens. Posted the config for review. –  khoxsey Sep 18 '12 at 18:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.