Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Performance Degradation in Python SDK (v3.18.2) When Reading High-Load YDB Topic

Đang mở
#670 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
distributed-systems

Hướng nghiên cứu

Bắt đầu với phần khởi tạo reader liên quan và mã receive_batch trong báo cáo, sau đó tái hiện workload bằng cách sử dụng hơn 2.000 partition, 24 tiến trình reader chạy song song và hoạt động ghi duy trì ở mức hơn 40k messages/sec. So sánh thông lượng của Python và C++, đồng thời truy vết luồng reader của Python để xác định lý do tốc độ đọc giảm từ khoảng 30k xuống 20k messages/sec; được xem là hoàn tất khi thông lượng Python ổn định dưới tải được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Bug Report

YDB Python SDK version:
3.18.2

Environment:

  • 24 parallel reader processes.
  • Topic with 2000 partitions
  • High write load (spikes of 40k+ messages/sec).

Current behavior:

  • Read throughput drops by ~33% (from ~30k to ~20k messages/sec) during high write loads.
  • Performance degradation persists until write load stabilizes.
  • No issues observed with the C++ SDK under identical conditions.

Expected behavior:

  • Python SDK should maintain stable read throughput (~30k messages/sec) regardless of write load, matching the C++ SDK’s performance.

Steps to reproduce:

  1. Configure a YDB topic with 2000+ partitions.
  2. Use Python SDK (v3.18.2) to read the topic with 24 parallel processes.
  3. Generate a sustained high write load (e.g., 40k+ messages/sec).
  4. Observe read throughput degradation in Python SDK while the C++ SDK remains stable.

Related code:

# Reader initialization  
async def init_client(self):  
    reader = self._ydb_driver.topic_client.reader(  
        topic=ydb.TopicReaderSelector(path=self._topic, partitions=self._partition_groups),  
        consumer=self._consumer_id,  
    )  
    self._reader = reader  

# Batch processing  
async def read_topic_partition(self) -> typing.List[typing.Tuple[datatypes.PublicMessage, int]]:  
    ...  
    events_batch = await asyncio.wait_for(  
        self._reader.receive_batch(max_messages=self._max_messages),  
        timeout=_CLIENT_TIMEOUT,  
    )  
    ...  
Ngôn ngữ chính
Python
Star
102
Fork
80
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ydb-platform/ydb-python-sdk

Tất cả issue của ydb-platform/ydb-python-sdk

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.