Forum Discussion

レザ's avatar
レザ
Icon for Cirrus rankCirrus
Sep 20, 2023

Load not equally distributed for server api calls

Hi,

I have 3 servers which i have to put behind balancer for load distribution. So i have configured a http virtual server (with cookie persistence).

Users can access services provided by these servers both through web browsers (when they are inside corporate) and also through api calls (when they are outside of corporate network).

The problem is when i direct outside users (i mean users which accessing via api calls via internet) traffics to the virtual server, the load distribution will uneven and always one of my pool memebers gets much more connection and requests from the other pool members, but for internal users everything is perfect.

I looked around and didn't get any results. my only guess is that the API requests would have to be balanced differently, but How?

I was wondering if anyone has had this experience?

Thank you for your guidance.

 

  • you probably find a few internet user connect long term and so keep the cookies long term .   thus if you down/up a pool member that will not have any long term users on it.   proxyies can also group your users.   what TTL on the cookie.        

  • you probably find a few internet user connect long term and so keep the cookies long term .   thus if you down/up a pool member that will not have any long term users on it.   proxyies can also group your users.   what TTL on the cookie.        

    • レザ's avatar
      レザ
      Icon for Cirrus rankCirrus

      Hi Kerry ,

      Thanks. After doing donwn/up the pool members, the problem was solved. I am using session cookie for persistence.

    • レザ's avatar
      レザ
      Icon for Cirrus rankCirrus

      Hi Daniel_Wolf 

      The problem was solved by doing down/up pool members. I am using least sessions load balancing algorithm for this pool and also i'm not using OneConnect on this virtual server.

      • Daniel_Wolf has a fair point to consider here,
        API's dont normally use cookies for persistance. If this is your heavily loads your experiencing down/up pool members just means you have fixed the problem for now by resetting everything as shortly you'll be in the same position as you were previously just on a different server.

        If your application only ever keeps one connection open or is always from one IP persistance will lock that user to one location and wont release it until the connection times out. A company of many users behind a NAT/Proxy normally cause this issue. I know this is the advantage of cookie persistance, but API client don't normally use this.

        How are you managing internal and external comms? One VS for each or a VS for external and internal?
        Potentially you could put them onto different Virtual servers to try to put different persistance on each config. Maybe even check that youir fallback persistence profile is also set so if cookies aren't set you still have something.
        Load Balancing is on the pool config so i think i'd leave that alone, i'd also keep away from having more than one pool with the same pool members in it otherwise you wont see the total picture.