Additional considerations with load balancing Turnkey and MDrivenServer
No edit summary
No edit summary
Line 1: Line 1:
=== Load balancing the Turnkey server ===
=== Load Balancing the Turnkey Server ===
Use sticky-session to make sure user returns to same node during the session.
Use sticky-session to make sure the user returns to the same node during the session.


If you need to signal the LoadBalancer we suggest that you model a page and make it RestAllow=true - give the url to your load balancer and return the data you have agreed upon. For example you may want to return Active , or InActive in order to implement some application setting to move traffic away from a node you will work on.
If you need to signal the LoadBalancer, we suggest that you model a page and make it RestAllow=true. Give the URL to your load balancer and return the data you have agreed upon. For example, you may want to return Active, or InActive in order to implement some application setting to move traffic away from a node you will work on.


In some examples we have a page named AreYouOkCheck and then LoadBalancer can check if 200Ok is returned from the url <nowiki>https://APP/App#/AreYouOkCheck/$null$</nowiki>
In some examples, we have a page named AreYouOkCheck and then LoadBalancer can check if 200Ok is returned from the URL: https://APP/App#/AreYouOkCheck/$null$  


=== Load balancing the MDrivenServer ===
=== Load Balancing the MDrivenServer ===
Use Fail-over in load balancer. Only 1 MDrivenServer should be used at a time - but you can have hot-standbys.
Use Fail-over in the Load Balancer. Only one MDrivenServer should be used at a time, but you can have hot standbys.


Since the load balancer must know which of multiple MDrivenServers that is candidate for being the hot one - and also remember which one is hot you can give the load balancer the url http://&#x3C;yourserver&#x3E;/home/ReturnNodeNameIfOk
Since the Load Balancer must know which of the multiple MDrivenServers is a candidate for being the hot one - and also remember which one is hot - you can give the Load Balancer the URL: https://&#x3C;yourserver&#x3E;/home/ReturnNodeNameIfOk  


You then set unique names of the nodes in the UserAndRolesAdmin page in MDrivenServer
You then set the unique names of the nodes in the UserAndRolesAdmin page in MDrivenServer.


It is important that the Hot-standbys do not execute ServerSide-jobs - since these should only be on One server.
It is important that the hot standbys do not execute ServerSide-jobs, since these should only be on One server.
[[File:2022-10-11 14h01 51.png|none|thumb|674x674px]]
[[File:2022-10-11 14h01 51.png|none|thumb|674x674px]]
1: Server name - make sure it is set - you want it unique per node in the load balance group
1: Make sure the Server name is set - you want it to be unique per node in the load balance group.


2: If the "Check Load balancer before running jobs" is not checked everything works as normal and periodic actions will always run (if the app is Started)
2: If the "Check Load balancer before running jobs" is not checked, everything works as normal and periodic actions will always run (if the app is Started).


3: If you set an url in Load Balanced MDrivenServerUrl we will - prior to running PeriodicActions - check that what we get back from <LoadBalancedAdress>/home/ReturnNodeNameIfOk - and if the returned value==TheNameOfThisServer we will know that we are the hot-one, if not we are not the hot one
3: If you set a URL in Load Balanced MDrivenServerUrl, you will - prior to running PeriodicActions - check that what you get back from <LoadBalancedAdress>/home/ReturnNodeNameIfOk - and if the returned value is ==TheNameOfThisServer, you will know that you have the hot-one; if not, you don't have the hot one.


4: The last known result from the Load balance check will be written to LoadBalancerStatus
4: The last known result from the Load balance check will be written to LoadBalancerStatus.


5: If you <s>check the "Hide server from loadbalancer"</s> we append the string "THIS NODE HAS REQUESTED TO BE LEFT ALONE" to the return name from /home/ReturnNodeNameIfOk - then the names will not match and we will not run periodicactions
5: If <s>check the "Hide server from loadbalancer"</s> we append the string "THIS NODE HAS REQUESTED TO BE LEFT ALONE" to the return name from /home/ReturnNodeNameIfOk - then the names will not match and we will not run periodic actions.


We changed the logic to a HideFromLoadBalancerUntil - being a datetime in the future - if in the future we now return a 500 error that load balancers will interpret as error. We will return this error until the timestamp has been passed - then the node becomes online again. This change will enable you to reach servers that may not be reachable from any other address that the load balanced
We changed the logic to a HideFromLoadBalancerUntil - being a DateTime in the future - if in the future we now return a 500 error that the Load Balancers will interpret as an error. We will return this error until the timestamp has been passed - then the node becomes online again. This change will enable you to reach servers that may not be reachable from any other address that the load balanced
[[File:2022-10-25 15h35 46.png|none|thumb|548x548px]]
[[File:2022-10-25 15h35 46.png|none|thumb|548x548px]]
[[File:2022-10-25 15h36 53.png|none|thumb|542x542px]]
[[File:2022-10-25 15h36 53.png|none|thumb|542x542px]]

Revision as of 07:45, 6 February 2023

Load Balancing the Turnkey Server

Use sticky-session to make sure the user returns to the same node during the session.

If you need to signal the LoadBalancer, we suggest that you model a page and make it RestAllow=true. Give the URL to your load balancer and return the data you have agreed upon. For example, you may want to return Active, or InActive in order to implement some application setting to move traffic away from a node you will work on.

In some examples, we have a page named AreYouOkCheck and then LoadBalancer can check if 200Ok is returned from the URL: https://APP/App#/AreYouOkCheck/$null$

Load Balancing the MDrivenServer

Use Fail-over in the Load Balancer. Only one MDrivenServer should be used at a time, but you can have hot standbys.

Since the Load Balancer must know which of the multiple MDrivenServers is a candidate for being the hot one - and also remember which one is hot - you can give the Load Balancer the URL: https://<yourserver>/home/ReturnNodeNameIfOk

You then set the unique names of the nodes in the UserAndRolesAdmin page in MDrivenServer.

It is important that the hot standbys do not execute ServerSide-jobs, since these should only be on One server.

2022-10-11 14h01 51.png

1: Make sure the Server name is set - you want it to be unique per node in the load balance group.

2: If the "Check Load balancer before running jobs" is not checked, everything works as normal and periodic actions will always run (if the app is Started).

3: If you set a URL in Load Balanced MDrivenServerUrl, you will - prior to running PeriodicActions - check that what you get back from <LoadBalancedAdress>/home/ReturnNodeNameIfOk - and if the returned value is ==TheNameOfThisServer, you will know that you have the hot-one; if not, you don't have the hot one.

4: The last known result from the Load balance check will be written to LoadBalancerStatus.

5: If check the "Hide server from loadbalancer" we append the string "THIS NODE HAS REQUESTED TO BE LEFT ALONE" to the return name from /home/ReturnNodeNameIfOk - then the names will not match and we will not run periodic actions.

We changed the logic to a HideFromLoadBalancerUntil - being a DateTime in the future - if in the future we now return a 500 error that the Load Balancers will interpret as an error. We will return this error until the timestamp has been passed - then the node becomes online again. This change will enable you to reach servers that may not be reachable from any other address that the load balanced

2022-10-25 15h35 46.png
2022-10-25 15h36 53.png
This page was edited 127 days ago on 01/11/2024. What links here