Load Balancing

Dinamo a load-balancing mechanism, enabling greater system availability and performance for applications. Up to 16 (sixteen) Dinamo units can be configured Dinamo a load-balancing system, with the same number of sessions on each unit. Load balancing is transparent to the application; that is, once enabled, the application benefits from it without requiring any changes.

Load balancing operates on a round-robin basis, distributing connections in a circular fashion among the configured HSMs. The load-balancing unit is the session with the HSM, regardless of the load or the APIs used in each session, as well as the resource utilization rate on each HSM. The HSM that will establish the session with the application is defined by the load-balancing configuration, not by the application. The load-balancing scheme operates on a per-process basis; that is, within each process, its own sessions are balanced. If two processes run simultaneously, each will have a separate and independent load-balancing structure.

If the application is using objects stored in the HSM, the object must exist in all the HSMs. It is recommended that an HSM is initially prepared with all the objects used by the application and a backup is generated from it, which will be restored in all the other HSMs that are part of the balancing set.

Info

Balancing cannot be used by applications that create objects within a session, need to persist these objects between sessions but do not use the HSM's replication mechanism, because in this case the creation of the object is not replicated between the HSMs and there is no guarantee that the next session will be directed to the HSM where the object was created. For applications that create objects that must persist between sessions, and the HSM replication mechanism is not used, it is up to the application to maintain a synchronization mechanism between the bases of the HSMs participating in the balancing. This mechanism can be based on exporting and importing objects, for example.

Load balancing and session caching are enabled through environment variables. If the environment variable settings aresystem-wide, all applications benefit from the load balancing and/or caching structure (since processes inherit the system’s environment variable settings). It is also possible to configure the system by setting the environment variable only for a specific application process. Refer to the operating system documentation for details on creating and setting the scope of environment variables.

Load balancing has the following characteristics:

  1. Intra-process: Load balancing is performed per process. This means that two applications on the same machine will have distinct load balancing sets;
  2. Centralized: implemented in the HSM library. This way, load balancing is enabled at a central point, and all other libraries that depend on it will inherit this functionality;
  3. Transparent: To enable load balancing, you only need to enable an environment variable. No changes to the application's source code are required.

For details on configuring the load-balancing mechanism, see the " Sessions - Load Balancing" topic.