Jump to content
Welcome to our new Citrix community!

Load Balancing a SpringBoot/Tomcat application


Recommended Posts

Our developers stood up a SpringBoot web application with Tomcat baked in. I set the two web front ends up on the load balancer and treated them like IIS sites which I am accustomed to but it does not appear to be load balancing. I have never load balanced such a thing; is there something special I need to know for this to work? 

Link to comment
Share on other sites

What behavior are you seeing that indicates it is not load balancing? (e.g. are all requests going to the same server?)

 

Can you share the configuration of the load balancing virtual server (in particular what method is being used)?

 

Spring boot is a Java technology so if the apps require sticky persistence, it would likely need to be done on the cookie name (developers should be able to provide this).

  • Like 1
Link to comment
Share on other sites

add serviceGroup svg_entry.neric.org_80 HTTP -maxClient 0 -maxReq 0 -cip DISABLED -usip NO -useproxyport YES -cltTimeout 180 -svrTimeout 360 -CKA NO -TCPB NO -CMP YES
add lb vserver vserver_entry.neric.org_443 SSL 163.153.114.11 443 -persistenceType NONE -cltTimeout 180
add lb vserver vserver_entry.neric.org_80 HTTP 163.153.114.11 80 -persistenceType NONE -cltTimeout 180
bind lb vserver vserver_entry.neric.org_443 svg_entry.neric.org_80
bind serviceGroup svg_entry.neric.org_80 survey19web01 80
bind serviceGroup svg_entry.neric.org_80 survey19web02 80
set ssl vserver vserver_entry.neric.org_443 -sslProfile ns_default_ssl_profile_frontend
bind ssl vserver vserver_entry.neric.org_443 -certkeyName star.neric.org-2022

add serviceGroup svg_entry.neric.org_80 HTTP -maxClient 0 -maxReq 0 -cip DISABLED -usip NO -useproxyport YES -cltTimeout 180 -svrTimeout 360 -CKA NO -TCPB NO -CMP YES
bind lb vserver vserver_entry.neric.org_443 svg_entry.neric.org_80
bind serviceGroup svg_entry.neric.org_80 survey19web01 80
bind serviceGroup svg_entry.neric.org_80 survey19web02 80
 

Link to comment
Share on other sites

What makes you think its NOT load balancing?  Are you not seeing services hit OR is app not working?

 

If your service members (destinations are UP), then the servicegroup will be UP.

You have your HTTP:80 vserver, bound to your port 80 servicegroup (web01 and web02)

You uhave your SSL:443 vserver also bound to your port 80 servicegroup (web01 and web02)

 

If you are identifying services by <name> then you should be specifying an FQDN in the server definition and ensure dns resolutions are working. If you are using service destinations via server objects by name (then no issue). j

 

You lb vservers have no lb method or persistence specified, which means you are using LB Method: Leastconnections (with fallback to roundrobin) and no persistence.   Depending on web app usually persistence by source ip is needed to work.

 

Via gui, you can select lb vserver > <specific lb vserver> > statistics to see distribution across services to confirm load balancing.

Via cli:  run:   stat lb vserver <lb vserver name>

And you can see same thing.

 

You may have to retrieve servicegroup to see distrubtion per servicegroup member.

 

Also is load balancing and ssl feature enabled;
show ns feature | grep ON

enable ns feature lb ssl

(or equivalent in GUI:  yellow exclamation points means feature is licensed and not enabled).  Load Balancing listed as Virtual Servers and SErvices or a RED Exclamation point means it is not licensed. If feature is either not licensed or not enabled, traffic ONLY hits first member in list and will not failover if down.

 

 

 

 

 

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Okay, the developer took the second web front end down for about ten days for some reason so I have been unable to test. I reenabled it today, let it crank (both servers were getting hits) and got a phone call about an hour later about getting kicked out. After talking with the developer a while I learn it is only admin pages, not the form itself which is just a simple one page thing; what he thinks is a lack of load balancing actually sounds like a persistence issue so I will be traveling down that path tomorrow. 

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...