OLS as loadbalancer?

#1
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?
 

lsfoo

Administrator
#2
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.
 
#3
Thanks for the fast reply.

then set up a load balancer external app that utilizes those backend ones.
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?
 
#5
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?
 

lsfoo

Administrator
#6
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
 
#8
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?
 

lsfoo

Administrator
#12
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
VERSION: LiteSpeed Web Server/Open/1.4.25
UPTIME: 01:04:23
BPS_IN: 4, BPS_OUT: 474, SSL_BPS_IN: 0, SSL_BPS_OUT: 0
MAXCONN: 300, MAXSSL_CONN: 200, PLAINCONN: 2, AVAILCONN: 297, IDLECONN: 3, SSLCONN: 1, AVAILSSL: 199
REQ_RATE []: REQ_PROCESSING: 0, REQ_PER_SEC: 9, TOT_REQS: 20062
REQ_RATE [example]: REQ_PROCESSING: 2, REQ_PER_SEC: 9, TOT_REQS: 19908
REQ_RATE [_AdminVHost]: REQ_PROCESSING: 0, REQ_PER_SEC: 0, TOT_REQS: 128
EXTAPP [Proxy] [example] [webserver1]: CMAXCONN: 35, EMAXCONN: 35, POOL_SIZE: 5, INUSE_CONN: 0, IDLE_CONN: 5, WAITQUE_DEPTH: 0, REQ_PER_SEC: 4, TOT_REQS: 8432
EXTAPP [Proxy] [example] [webserver2]: CMAXCONN: 35, EMAXCONN: 35, POOL_SIZE: 5, INUSE_CONN: 1, IDLE_CONN: 4, WAITQUE_DEPTH: 0, REQ_PER_SEC: 2, TOT_REQS: 6458
EXTAPP [Proxy] [example] [webserver3]: CMAXCONN: 35, EMAXCONN: 35, POOL_SIZE: 5, INUSE_CONN: 1, IDLE_CONN: 4, WAITQUE_DEPTH: 0, REQ_PER_SEC: 2, TOT_REQS: 4990
BLOCKED_IP:
EOF
 
#14
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.
I see, is there any way to set a global limit?
 

lsfoo

Administrator
#15
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).
 
Top