On the Apinizer platform Load Balancer Servers between Gateway and API are the endpoint addresses of your Backend API that run on more than one server.

Figure: Routing

  • The Request Routing server is installed with default values ​​when the gateway is created. If you want to edit, click the Routing button in the message area between Gateway and API on the Gateway Formatting screen. In the Request Routing window that opens, the fields that are described below are entered.

    • Algorithm: Selects the algorithm for load balancing. The table in which the application servers are located is managed.
    • Connect Timeout (ms) : The time to connect to a server is given in milliseconds. If the server cannot connect during this time, the request is forwarded to another server.
    • Read Timeout (ms) : If no response is returned from the server during this time, in milliseconds, the request is forwarded to another server.
    • Error Code for Retry: If the API returns any of the error codes specified here, the request is forwarded to the other servers.
    • Retry Count: The number of times the same server will be run is entered.
    • Failover Retry Count: If unsuccessful trials are in progress, the amount of time to stop after most attempts is entered.
    • Circuit Breaker: Activates the Circuit Breaker when this option is selected.
  • Click the Save button to perform the operation.

Request Routing Algorithms; Round Robin - The gateway requests are distributed according to the list of addresses that are ordered. The load balancer directs incoming requests according to the address order in the list. At the end of the list, the load balancer returns to the top of the list and the same cycle continues. LRU (Least Recently Used) - The load balancer routes the incoming request to the server that has not been used for the longest time between servers. Weighted - The user assigns weight to the servers. This weight is taken into account in the order of requests to the servers respectively. Random - Requests are routed to randomly selected servers.