Skip to content

Whapi-Cloud/whatsapp-api-balancer-example-node-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Request Distributor (Balancer)

A large number of channels require additional measures from the developer to ensure that all these channels work efficiently and reliably. This is where we turn to the balancer, which helps evenly distribute requests across all channels, ensuring efficient results retrieval.

Thus, when the script is launched, a chain of your channels is created, which sequentially perform the same actions, replacing each other. 

If one channel is blocked, other channels take its place to ensure uninterrupted operation.

Balancer Objectives

  1. Even load distribution, requests are distributed among different channels, allowing to avoid overloading one channel and increase the overall system efficiency.
  2. Maximizing performance, requests are directed to available channels to utilize resources efficiently and ensure fast completion of the overall task.
  3. Ensuring fault tolerance, if one of the channels is unavailable or overloaded, the balancer will redirect requests to other working channels, minimizing downtime and interruptions in operation.

Advantages of the balancer

  1. Improved reliability. Using a balancer reduces the likelihood of overload or failure of individual channels, increasing the overall system reliability.
  2. Scalability simplicity. Adding additional channels or resources to the balancer is usually a straightforward process, providing ease of system scaling with increased load.

Using the balancer significantly increases the reliability and efficiency of mass automation, ensuring stable operation and minimizing the risks of blocking.

To get started, you'll need to configure the script settings: insert the tokens of your channels and set the values for pauses between requests (which affects the overall script execution speed).

Its functionality includes checking the status of channels: if any channel becomes inactive (due to a failure, blockage, or lack of authorization), it is excluded from the chain, and the remaining channels take over its tasks. Furthermore, the script adds operational channels to the queue for executing functions, calculating a random pause before its execution. This allows for dynamic pauses between task executions. Thus, if one of the channels becomes unavailable, the task execution duration may increase, as the resource quantity diminishes, but the remaining channels do not accelerate. To speed up the task execution process, simply connect more channels to the script.

About

Allows you to run a chain of channels to perform WhatsApp API actions with a single goal (mailing, checker, etc.) with interleaving of each other, checking of channels and distribution of requests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published