dbworker 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dbworker-0.1.2 → dbworker-0.1.3}/PKG-INFO +11 -11
- {dbworker-0.1.2 → dbworker-0.1.3}/README.md +10 -10
- {dbworker-0.1.2 → dbworker-0.1.3}/pyproject.toml +1 -1
- {dbworker-0.1.2 → dbworker-0.1.3}/src/dbworker.py +11 -1
- {dbworker-0.1.2 → dbworker-0.1.3}/LICENSE +0 -0
- {dbworker-0.1.2 → dbworker-0.1.3}/poetry.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dbworker
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Portable, single-script Python/SQLAlchemy background worker for SQLite, PostgreSQL and MySQL — no Redis, broker or enqueue
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -94,16 +94,16 @@ Median wall time in seconds; **bold** marks the faster backend. Each experiment
|
|
|
94
94
|
|
|
95
95
|
| Experiment | Workload | Celery wall (s) | DBWorker wall (s) | C / D | Task P95 / peak outstanding (C; D) |
|
|
96
96
|
|---|---|---:|---:|---:|---|
|
|
97
|
-
| imagededup | Build 1,000 image hashes (one bulk import) |
|
|
98
|
-
| imagededup | Compare 1,000 images / 999,000 directed pairs |
|
|
99
|
-
| imagededup | Build + compare 1,000 images / 999,000 directed pairs |
|
|
100
|
-
| superset | SQL Lab: 3,000 queries / 10,000 rows | **
|
|
101
|
-
| saleor | Export: 1,000 x 256 products + 1,000 emails | **
|
|
102
|
-
| paperless_ngx | OCR: 200 scans, archive and index |
|
|
103
|
-
| posthog | 2FA: 5,000 requests / 10,000 tasks |
|
|
104
|
-
| sentry | Email: 2,000 requests / 4,000 deliveries | **60.
|
|
105
|
-
|
|
106
|
-
Run: `github-
|
|
97
|
+
| imagededup | Build 1,000 image hashes (one bulk import) | 6.459 | **6.005** | 1.08 | n/a; n/a |
|
|
98
|
+
| imagededup | Compare 1,000 images / 999,000 directed pairs | 81.712 | **77.167** | 1.06 | n/a; n/a |
|
|
99
|
+
| imagededup | Build + compare 1,000 images / 999,000 directed pairs | 92.450 | **88.584** | 1.04 | n/a; n/a |
|
|
100
|
+
| superset | SQL Lab: 3,000 queries / 10,000 rows | **153.735** | 168.862 | 0.91 | 42.354s / 1462; 48.725s / 1511 |
|
|
101
|
+
| saleor | Export: 1,000 x 256 products + 1,000 emails | **137.652** | 167.635 | 0.82 | 39.572s / 630; 54.428s / 812 |
|
|
102
|
+
| paperless_ngx | OCR: 200 scans, archive and index | 142.059 | **81.849** | 1.74 | 78.973s / 118; 57.944s / 61 |
|
|
103
|
+
| posthog | 2FA: 5,000 requests / 10,000 tasks | 184.240 | **164.843** | 1.12 | 0.161s / 14; 0.179s / 30 |
|
|
104
|
+
| sentry | Email: 2,000 requests / 4,000 deliveries | **60.314** | 60.336 | 1.00 | 0.057s / 16; 0.479s / 149 |
|
|
105
|
+
|
|
106
|
+
Run: `github-38401468222-1`. [Details and scope](doc/benchmark-results.md) · [JSON results](benchmarks/results/latest/index.json).
|
|
107
107
|
Scoped application workloads; Sentry uses historical 24.1.0. Wall time includes the fixed submission window, so a ratio near 1 does not prove equal processing capacity. Task P95 starts at publication; peak outstanding counts already published tasks. Ratios above 1 favor DBWorker; no cross-project average is computed.
|
|
108
108
|
<!-- benchmark-results:end -->
|
|
109
109
|
|
|
@@ -77,15 +77,15 @@ Median wall time in seconds; **bold** marks the faster backend. Each experiment
|
|
|
77
77
|
|
|
78
78
|
| Experiment | Workload | Celery wall (s) | DBWorker wall (s) | C / D | Task P95 / peak outstanding (C; D) |
|
|
79
79
|
|---|---|---:|---:|---:|---|
|
|
80
|
-
| imagededup | Build 1,000 image hashes (one bulk import) |
|
|
81
|
-
| imagededup | Compare 1,000 images / 999,000 directed pairs |
|
|
82
|
-
| imagededup | Build + compare 1,000 images / 999,000 directed pairs |
|
|
83
|
-
| superset | SQL Lab: 3,000 queries / 10,000 rows | **
|
|
84
|
-
| saleor | Export: 1,000 x 256 products + 1,000 emails | **
|
|
85
|
-
| paperless_ngx | OCR: 200 scans, archive and index |
|
|
86
|
-
| posthog | 2FA: 5,000 requests / 10,000 tasks |
|
|
87
|
-
| sentry | Email: 2,000 requests / 4,000 deliveries | **60.
|
|
88
|
-
|
|
89
|
-
Run: `github-
|
|
80
|
+
| imagededup | Build 1,000 image hashes (one bulk import) | 6.459 | **6.005** | 1.08 | n/a; n/a |
|
|
81
|
+
| imagededup | Compare 1,000 images / 999,000 directed pairs | 81.712 | **77.167** | 1.06 | n/a; n/a |
|
|
82
|
+
| imagededup | Build + compare 1,000 images / 999,000 directed pairs | 92.450 | **88.584** | 1.04 | n/a; n/a |
|
|
83
|
+
| superset | SQL Lab: 3,000 queries / 10,000 rows | **153.735** | 168.862 | 0.91 | 42.354s / 1462; 48.725s / 1511 |
|
|
84
|
+
| saleor | Export: 1,000 x 256 products + 1,000 emails | **137.652** | 167.635 | 0.82 | 39.572s / 630; 54.428s / 812 |
|
|
85
|
+
| paperless_ngx | OCR: 200 scans, archive and index | 142.059 | **81.849** | 1.74 | 78.973s / 118; 57.944s / 61 |
|
|
86
|
+
| posthog | 2FA: 5,000 requests / 10,000 tasks | 184.240 | **164.843** | 1.12 | 0.161s / 14; 0.179s / 30 |
|
|
87
|
+
| sentry | Email: 2,000 requests / 4,000 deliveries | **60.314** | 60.336 | 1.00 | 0.057s / 16; 0.479s / 149 |
|
|
88
|
+
|
|
89
|
+
Run: `github-38401468222-1`. [Details and scope](doc/benchmark-results.md) · [JSON results](benchmarks/results/latest/index.json).
|
|
90
90
|
Scoped application workloads; Sentry uses historical 24.1.0. Wall time includes the fixed submission window, so a ratio near 1 does not prove equal processing capacity. Task P95 starts at publication; peak outstanding counts already published tasks. Ratios above 1 favor DBWorker; no cross-project average is computed.
|
|
91
91
|
<!-- benchmark-results:end -->
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "dbworker"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "Portable, single-script Python/SQLAlchemy background worker for SQLite, PostgreSQL and MySQL — no Redis, broker or enqueue"
|
|
9
9
|
authors = ["Ziyang Song"]
|
|
10
10
|
license = "MIT"
|
|
@@ -522,7 +522,17 @@ class Coordinator:
|
|
|
522
522
|
next_renewal = time.monotonic() + self.lease_seconds / 3
|
|
523
523
|
if not self._stop.is_set() and time.monotonic() >= next_claim_at:
|
|
524
524
|
while len(active) < worker.concurrency and not self._stop.is_set():
|
|
525
|
-
|
|
525
|
+
try:
|
|
526
|
+
claims = self._claim_many(worker, worker.concurrency - len(active))
|
|
527
|
+
except OperationalError as exc:
|
|
528
|
+
if (not isinstance(exc.orig, sqlite3.OperationalError)
|
|
529
|
+
or getattr(exc.orig, "sqlite_errorcode", None) not in (
|
|
530
|
+
sqlite3.SQLITE_BUSY, sqlite3.SQLITE_BUSY_RECOVERY,
|
|
531
|
+
sqlite3.SQLITE_BUSY_TIMEOUT, sqlite3.SQLITE_BUSY_SNAPSHOT,
|
|
532
|
+
)):
|
|
533
|
+
raise
|
|
534
|
+
logger.exception("Error claiming work for %s; retrying after backoff", worker.name)
|
|
535
|
+
claims = []
|
|
526
536
|
if not claims:
|
|
527
537
|
next_claim_at = time.monotonic() + delay
|
|
528
538
|
delay = min(delay * 2, self.max_poll_seconds)
|
|
File without changes
|
|
File without changes
|