Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • 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 Sharded PostgreSQL
  • Getting started
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
    • General questions
    • Distributed queries
    • Connection
    • Security
    • Performance
    • Migration
    • Limitations
    • Troubleshooting
    • All questions on one page
  1. FAQ
  2. Performance

Managed Service for Sharded PostgreSQL cluster performance

Written by
Yandex Cloud
Updated at June 23, 2026
  • How to improve performance?

  • How to reduce reading latency?

  • How to limit the load caused by data uploads?

  • How to set up reading from replicas?

  • What resources are required for routers and coordinators?

How to improve performance?How to improve performance?

  • Increase the resources (CPU, RAM) of your existing routers.

  • Add new routers.

  • Disable debug logging for routers to reduce load on your computing resources.

  • In the router configuration, disable show_notice_messages because NOTICE messages increase load on Sharded PostgreSQL.

  • Avoid frequent reconnections: set up connection pooling in your application.

  • Enable reading from replicas. Do it by providing this virtual parameter in an SQL query:

    SELECT * FROM orders /* target-session-attrs: read-only */;
    
  • Limit execution time for long queries:

    SET session_duration_timeout = '5min';
    

How to reduce reading latency?How to reduce reading latency?

  • Enable reading from replicas:

    SELECT * FROM table /* target-session-attrs: read-only */;
    
  • Increase max_connections for the user.

How to limit the load caused by data uploads?How to limit the load caused by data uploads?

  • Create a separate user and limit the number of connections for them (conn_limit setting).
  • Use a dedicated router for ETL operations.
  • Set session_duration_timeout to automatically end long sessions.

How to set up reading from replicas?How to set up reading from replicas?

You can specify multiple servers for one shard in the configuration. The router will automatically distribute read-only queries across replicas. For a specific query, you can explicitly set the target-session-attrs parameter:

  • read-write (default): Queries only to the master.
  • smart-read-write: Queries only to the master, but with read-only queries redirected to replicas.
  • read-only: Queries only to replicas (if available).
  • prefer-standby or prefer-replica: Queries to replicas. If none are available, queries are forwarded to the master.
  • any: Queries to any available node (preferably local). To reduce latency, we recommend to use this value in conjunction with closest host selection.

What resources are required for routers and coordinators?What resources are required for routers and coordinators?

We recommend selecting the computing resource configuration for the router and coordinator based on the expected load.

Recommended configurations for a load of 20,000 read requests per second:

Level of requirements

Router configuration

Coordinator configuration

General configuration

Minimum

  • Three routers. Each router's host class must include four vCPUs with a vCPU guarantee of 100% and 16 GB of RAM.
  • local-ssd disk, 10 GB

  • Three coordinators. Each coordinator's host class must include two vCPUs with a guaranteed vCPU share of 100% and 4 GB of RAM.
  • local-ssd disk, 10 GB
  • 18 vCPUs with a vCPU guarantee of 100%.
  • 60 GB RAM.
  • local-ssd disks, 60 GB

Optimal

  • Three routers. Each router's host class must include four vCPUs with a vCPU guarantee of 100% and 16 GB of RAM.
  • local-ssd disk, 10 GB
  • Three coordinators. Each coordinator's host class must include two vCPUs with a vCPU guarantee of 100% and 8 GB of RAM.
  • local-ssd disk, 10 GB
  • 18 vCPUs with a vCPU guarantee of 100%.
  • 72 GB RAM.
  • local-ssd disks, 60 GB

With a margin

  • Five routers. Each router's host class must include four vCPUs with a vCPU guarantee of 100% and 16 GB of RAM.
  • local-ssd disk, 10 GB
  • Three coordinators. Each coordinator's host class must include two vCPUs with a vCPU guarantee of 100% and 8 GB of RAM.
  • local-ssd disk, 10 GB
  • 26 vCPUs with a vCPU guarantee of 100%.
  • 104 GB RAM.
  • local-ssd disks, 80 GB

To calculate the cost of a Managed Service for Sharded PostgreSQL cluster, use this calculator.

Was the article helpful?

Previous
Security
Next
Migration
© 2026 Direct Cursus Technology L.L.C.