Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge CPU usage of qdrant client when deserializing payload #714

Open
GDegrove opened this issue Aug 2, 2024 · 4 comments
Open

Huge CPU usage of qdrant client when deserializing payload #714

GDegrove opened this issue Aug 2, 2024 · 4 comments

Comments

@GDegrove
Copy link

GDegrove commented Aug 2, 2024

Title: High CPU Usage with Qdrant Async Client for GRPC and REST Endpoints

Description:

We are experiencing significant CPU usage spikes when enabling the Qdrant async client for both GRPC and REST endpoints. By utilizing a profiling tool (Parca), we have identified that a considerable portion of CPU time is being consumed by payload deserialization.

This issue is particularly problematic for applications like recommendation engines that rely on Qdrant as a vector database, as it results in a substantial increase in CPU requirements for our application.

Steps to Reproduce:

  1. Enable Qdrant async client for both GRPC and REST endpoints.
  2. Run the application and perform standard operations.
  3. Monitor CPU usage and analyze with a profiling tool (e.g., Parca).

Expected Behavior:

  • Efficient CPU usage when deserializing payloads.

Actual Behavior:

  • High CPU usage is observed, primarily due to payload deserialization.

Environment:

  • Qdrant version: [Specify version]
  • GRPC and REST async client setup
  • Profiling tool: Parca

Proposed Solution:

To mitigate the high CPU usage, we propose utilizing orjson for JSON serialization and deserialization. orjson is known for its performance benefits compared to the standard JSON library in Python. By replacing the current deserialization process with orjson, we anticipate a reduction in CPU overhead.

Additional Context:
This CPU overhead is posing a challenge in deploying Qdrant in resource-constrained environments. Any guidance or fixes to address this issue would be greatly appreciated.

@joein
Copy link
Member

joein commented Aug 2, 2024

hi @GDegrove

just to be sure, could you also provide the version of pydantic you're using?

@GDegrove
Copy link
Author

GDegrove commented Aug 2, 2024

hi @GDegrove

just to be sure, could you also provide the version of pydantic you're using?

We are using pydantic 2, for exactitude version = "2.8.2"

@joein
Copy link
Member

joein commented Aug 7, 2024

We'll try to look into it, thanks for pointing it out

@arthur-st
Copy link

Pydantic doesn't use the json package from the standard library for handling de/serialization. Instead, it handles that internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants