• Good evening,

    I currently have the following setup ::

    2x WordPress Servers (Apache, PHP, WordPress)
    1x Database Server (MariaDB)
    1x External Load Balancer (Public IP)

    The issue that I am facing is that when the front-end developer is working in wp-admin, he randomly gets booted from it.

    My thoughts are that this is because while he browses through different parts of wp-admin, the load balancer is bouncing between two servers and something happens with the session (ie. he logs into wp-admin from web server 1 and say he clicks on ‘Pages’, the next request goes to web server 2 but web server 2 isn’t aware of the active wp-admin session).

    It is not plausible to always have to remove one server from the load balancer anytime he needs to make changes, because it would result in a temporary single point of failure (only 1 web server serving requests).

    What can be done about this? I know I cannot be the only one who has ran into this challenge.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You don’t say what kind of persistence method you are using for the load balancer?

    Assuming that you are using HAProxy you could use either cookie persistence or source IP persistence to ensure that each client always hits the same server.

    Tim Nash

    (@tnash)

    Spam hunter

    This will be very much dependent specific setup but sounds like your sessions are getting out of sync on the two servers.

    On your two WordPress servers, how is PHP managing it sessions? (hint you might want to consider even at the cost of performance using the db)

    Also what is doing the load balancing, how is it configured?

    Thread Starter mikedcmdva

    (@mikedcmdva)

    Hello all,

    It’s pretty much an out of the box PHP configuration, so whatever the default is.

    Load balancing – it’s your standard round robin load balancing. No session affinity. I did consider changing it to use session affinity by client IP. Would this resolve the issues I am having?

    It’s in Azure by the way, so it’s an Azure external load balancer.

    Tim Nash

    (@tnash)

    Spam hunter

    Try looking at putting your PHP sessions into your mysql db, so they get shared across the two containers.

    Thread Starter mikedcmdva

    (@mikedcmdva)

    Hi Tim,

    That sounds like an interesting solution. Have you done this before? Would you have any documentation on the process? I am not familiar with it. Something mainly a Windows/IIS/Microsoft SQL guy like myself wouldn’t find too intimidating?

    In the meantime, I enabled client-IP based session affinity on the load balancer. I logged into wp-admin myself and browsed around a bit without any issues – but I am awaiting on feedback from the web developer.

    Thank you!

    Michael

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Load Balancing and WordPress Question’ is closed to new replies.