I've been trying to figure this one out for a while now, but so far no success. After contacting DigitalOcean support a couple of times, I'm even more lost.

I have the following setup: domain points to a DO loadbalancer which is in front of two app droplets hosting my app built on codeigniter. A third droplet has my database server. app servers are PHP7 with php+fpm

Since app droplets are loadbalanced, I handle sessions on the database, which works fine from a user standpoint.

The LB health checks are configured to run every 10 seconds on HTTP and the target is a codeigniter-generated page.

Summary so far: Since health checks are every 10 seconds (6 per minute) directed to 2 droplets, I would expect 12 health checks per minute total. Given that DO silently has automatic failover, we may assume that number would be in fact 24 checks per minute (if they also sent checks from the failover LB) so 1440 per hour. The "double" checks are actually a reality, since my session table has an equal amount of traffic from two distinct and consecutive IPs in the private range.

The problem: I'm actually seeing exactly 4 times the amount of sessions I'd expect from the load balancers (instead of ~1440 per hour I'm seeing consistent figures of ~5760 sessions per hour). DigitalOcean couldn't figure it out.

The amount of sessions is not a real problem since I have a garbage collection (for lack of a better name) that clears empty sessions several times a day to keep the table small, but I'm puzzled about this. I know I could just space health checks a bit or point the checks to a URL which doesn't launch the session handler library, but both mitigations defeat the purpose.

Has anyone seen behavior like this? Any ideas? I've been chasing this for about a month now.

  • 2
    Possibly: Your app supports multiple entry points, for instance both HTTP and HTTPS. - Those are independent service definitions in the load balancer. - Each service definition runs their own health checks. – HBruijn Aug 28 '18 at 14:38
  • 1
    Good point. Perhaps that has something to do with it since I'm having the LB force HTTPS at all times, plus I have 2 different forwarding rules (HTTP and HTTP2)... that explains the 4x traffic mistery solved!! Thanks so so much! – Javier Larroulet Aug 28 '18 at 14:50

Without detailed knowledge of the internal workings of the loadbalancer:

I suspect that health-cecks are executed on behalf of each entry point, each service that is defined in the loadbalancer.

If you have both a HTTP and a HTTPS entry point that both go the same back-end, that will result in two individual health-checks, doubling the number of requests you see.

  • Thanks. That is exactly the missing link I'd been overlooking. A second entry point checked by the LB and its failover adds up to the amount of hits I'm getting. Many thanks for giving me peace of mind :) – Javier Larroulet Aug 28 '18 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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