Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for MySQL®
  • Getting started
    • Resource relationships
    • High availability clusters
    • Networking in Managed Service for MySQL
    • Quotas and limits
    • Storage in Managed Service for MySQL®
    • Backups
    • Load balancer for hosts
    • Replication
    • Maintenance
    • User permissions
    • MySQL settings
    • SQL command limits
    • Comparing MySQL® 5.7 and 8.0
    • MySQL® versioning policy
  • Access management
  • Inspections and recommendations
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  1. Concepts
  2. Load balancer for hosts

Load balancer for hosts

Written by
Yandex Cloud
Updated at October 27, 2026
View in Markdown

Managed Service for MySQL® allows you to use an internal network balancer to distribute the load among hosts. This load balancer operates on layer 4 of the OSI network model but uses layer 3 technologies to speed up packet processing.

Note

This feature is at the Preview stage. Contact support for access.

Using a load balancer gives you the following advantages:

  • A single entry point for connecting to the master host.
  • Even distribution of read requests among replicas that factors in their load.
  • Choice of load balancing policy. For example, you can set Least connections to distribute load among replicas with the fewest connections.
  • Minimization of cluster unavailability during master failover or changes in the replica composition.
  • To switch the application to a new cluster when restoring from a backup, you just need to replace a single FQDN.

The load balancer automatically accounts for changes in cluster topology: new replicas are included in load balancing, and removed ones are excluded.

In the cluster architecture, the load balancer is implemented as a separate service that can be enabled when creating a cluster. The load balancer is assigned a single FQDN common to all availability zones, which serves as a single entry point for all database requests. A load balancer instance is provisioned in every availability zone where your cluster hosts reside.

The load balancer stops and starts simultaneously with the cluster stop and start. The load balancer distributes incoming traffic across all hosts in the cluster. It automatically adds or removes hosts from the load balancing pool as your cluster scales up or down.

To get the load balancer’s FQDN, follow this guide.

The network traffic regulation schema for the cluster using a load balancer is shown below:

Warning

We do not recommend creating a Network Load Balancer (NLB) manually for cluster access. The load balancer that is automatically created during cluster deployment has a critically important proxy configuration. Without this configuration, the NLB will block traffic to the handler ports, resulting in loss of access to the cluster.

When the load balancer is enabled, it remains possible to connect directly to the database via the host FQDN, bypassing the load balancer.

A separate proxy service based on HAProxy is used to analyze the state and load of hosts. The proxy service is deployed on each host the following functions:

  • Monitoring host availability.
  • Checking replica lag.
  • Verifying host role.

The load balancer provides several special ports for target connections:

Port

Target connection

3306

Master host

4307

All replicas

4306

Replicas lagging less than the predefined value

5307

Cascade replicas

Traffic from each open port of the load balancer is directed to the proxy service and then distributed to target connections depending on the port number.

For example, to distribute read requests only among replicas with a lag of no more than 30 seconds:

  1. Create a cluster with the load balancer enabled and specify a replica lag value of 30 seconds in the 4306 port settings.
  2. Specify the database connection string with the load balancer FQDN and port 4306 in your application settings.

Balancing policiesBalancing policies

Using balancing policies, you can configure a balancer's behavior when distributing queries across cluster replicas. A policy is specified for all types of target connections to replicas when creating a cluster.

The following policies are available:

  • Round Robin: Selects a replica according to the Round-Robin policy.
  • Least connections: Selects the replica with the fewest connections.
  • Localized Round Robin: When selecting a replica according to the round-robin policy, priority is given to replicas in the same availability zone as the balancer's instance receiving the query.

Was the article helpful?

Previous
Backups
Next
Replication
© 2026 Direct Cursus Technology L.L.C.