Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Load balancer for Leshan

Thank you Kai,

I think option 2 would be a preferred solution and I will work on it. What is the recommended way of passing configurations(e.g storage information) to Leshan server?  

Thanks,
Mrinal  
 

On Fri, Oct 30, 2015 at 10:45 AM, Kai <sophokles.kh@xxxxxxxxx> wrote:
Hi Mrinal,

there is two aspects to this:
1) How to distribute load between multiple instances of leshan
2) What happens if one of the leshan instances crashes

Regarding 1) A simple strategy might be to put an IP load balancer in front of the leshan instances and route requests to leshan instances based on source IP. This is easy to set up but has the drawback of potentially not distributing the load evenly (depending on the algorithm used to determine the leshan instance based on the IP address). An advantage of this strategy is that session data can remain in-memory and does not need to be replicated/shared among the instances which allows for a very simple set-up (share nothing). If you want to use somethin glike round-robin load balancing you will need to share session data among the leshan instances which brings us to the other aspect...

Regarding 2) If you don't mind clients to re-establish the connection to leshan, you can simply re-start the failed instance and loose all existing sessions. If this is a problem and you need something like session fail-over, you will need to share session state among the leshan instances. 
Session state consists of registration data, active observations and security related information which is kept in three registries
- org.eclipse.leshan.server.client.ClientRegistry
- org.eclipse.leshan.server.observation.ObservationRegistry
- org.eclipse.leshan.server.security.SecurityRegistry

The default implementations of these registries are all in-memory only. Thus, if you want to share session data among instances, you will need to create custom implementations that share the data using e.g. a database or a data grid/cache as suggested by you.

We would also like to invite you to think about contributing your code if you create such an implementation :-)

Regards,
Kai

On Fri, Oct 30, 2015 at 3:35 AM Mrinal Sharma <mrinals@xxxxxxxxx> wrote:
Hello,

I want to check with the group about use of Load balancers with Leshan server.
  1. As the Registration data is in memory, how the load balancer is expected to work?
  2. Is it possible to store registration data in DB and have all Leshan Servers connect to the database for Registration check?

Thanks,

Mrinal

_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev

_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev



Back to the top