Closed movchan74 closed 1 month ago
To measure the overhead of processing a task from a queue, a dummy application was used. This application simply returns lowercase text. Two request handlers were consistently used for these measurements.
Setup | Workers | Time per Query (ms) |
---|---|---|
Without Queue | N/A | 12 |
SQLite Queue | 2 | 33 |
SQLite Queue | 4 | 31 |
PostgreSQL Queue | 4 | 21 |
Observation: The overhead introduced by using a task queue is noticeable. However, increasing the number of workers beyond 4 does not significantly reduce the processing time.
To simulate a more realistic workload, a task was modified to include a 100 ms sleep. This adjustment was made to better understand the queue's impact under a more demanding scenario.
Setup | Workers | Time per Query (ms) |
---|---|---|
Without Queue | N/A | 101.81 |
SQLite Queue | 4 | 103.57 |
PostgreSQL Queue | 4 | 102.12 |
Observation: When simulating a real workload with a 100 ms sleep, the difference between using a queue and processing tasks without a queue becomes minimal. The overhead introduced by the queue is less significant compared to the total processing time of the task.
Conclusion: While queues introduce some overhead in low-latency scenarios, their impact is substantially reduced under heavier workloads.
Summary: This update introduces a task queue system to the project, enabling deferred execution of endpoints. This feature allows users to submit multiple tasks for background processing, which is particularly beneficial for long-running operations like indexing.
Key Changes: