OLS as loadbalancer?

Discussion in 'General OpenLiteSpeed Discussion' started by silentneedle, Mar 16, 2017.

  1. silentneedle

    silentneedle New Member

    I usually use haproxy as loadbalancer, but I really like how the things work with litespeed, so I'm currently think about to switch to ols, if that's possible.

    I know it's possible to setup ols as reverse proxy, but is it also possible to add multiple backend server?
     
  2. lsfoo

    lsfoo Administrator

    It's possible to make OLS a simple Load Balancer. You just have to set up a the backend external apps (fcgi(Fast CGI App), lsapi(LSAPI App), servlet(Servlet/JSP Engine), proxy(Web Server)) and then set up a load balancer external app that utilizes those backend ones.

    Then you just need to point a vhost to use the load balancer external app.

    This will only do round robin, and there is no session tracking, so the load balancing will be somewhat limited, but it is possible.

    We do have a load balancer product, but I'm guessing that you're looking for open source/free versions, so hopefully this will suffice.
     
    silentneedle likes this.
  3. silentneedle

    silentneedle New Member

    Thanks for the fast reply.

    Could you elaborate this a little bit more? So let's say I have setup a external app (Webserver) with the name "test" which is just another OLS installation. To use this app I just need to enter proxy::test in the workers part of the loadbalancer?
     
  4. lsfoo

    lsfoo Administrator

    I need to confirm it, but I believe that is correct.
     
  5. silentneedle

    silentneedle New Member

    Loadbalancing works as described, thank you. I still have a quick question regarding external webserver applications. Does the "Connection Keep-Alive Timeout" setting relates to connections between the loadbalancer and the webserver, or between the client and the loadbalancer?
     
  6. lsfoo

    lsfoo Administrator

    Hi @silentneedle

    Is that setting in the ext web server application configuration? If that is the case, I believe it means any connection to the ext web server app. This means the Load Balancer connection if that is the one connecting to the web server or the client if the client is connecting directly to that web server app. I will confirm this when I have a chance.

    Cheers,
    Kevin
     
  7. silentneedle

    silentneedle New Member

    Yes, that's the setting I'm talking about.

    Thanks!
     
  8. silentneedle

    silentneedle New Member

    Hey lsfoo,

    I've set the max connections for each of my backend server to 35, but when I access the realtime stats window it shows 140 at max conn & eff max, any idea why my settings are ignored?
     
  9. lsfoo

    lsfoo Administrator

    What is showing 140 max? External App real time?
     
  10. silentneedle

    silentneedle New Member

    Yes, on each backend server.
     
  11. lsfoo

    lsfoo Administrator

    Could you paste the output from all the /tmp/lshttpd/.rtreport*?
     
  12. lsfoo

    lsfoo Administrator

    I just went through the code. I think you are seeing 140 because it's 35 max connections per litespeed process. You likely have 4 processes and each of them have 35 max connections. The resulting real time report is a summation of the four.
     
  13. silentneedle

    silentneedle New Member

     
  14. silentneedle

    silentneedle New Member

    I see, is there any way to set a global limit?
     
  15. lsfoo

    lsfoo Administrator

    Each process spawned works independently of each other, so there's no way to set a global limit. Probably the easiest way to handle this is to divide the desired number by the number of processes you have (e.g. use 9 if you have 4 processes).
     
    silentneedle likes this.
  16. silentneedle

    silentneedle New Member

    That works fine, thank you.

    I'm receiving the following two errors on that server, not oft, but multiple times daily:

    Any idea what could cause this?

    p.s. The server has 16 GB ram
     
  17. lsfoo

    lsfoo Administrator

    Will get back to you tomorrow. In the meantime, could you check your disk space usage with df -h and df -i to see if anything is out of the ordinary?
     
    silentneedle likes this.
  18. silentneedle

    silentneedle New Member

    Everything seems to be fine. There is about 300 GB free disk space.
     
  19. lsfoo

    lsfoo Administrator

    Could you post or pm me your server and vhost settings?
     
  20. silentneedle

    silentneedle New Member

Share This Page