Allgemeine Performance Optimierungen fuer 1M+ Datensaetze
1. Generic Pagination Utility (app/core/pagination.py): - approximate_count: pg_class.reltuples statt SELECT count(*) (5000x schneller) - paginated_list: Generic keyset/offset pagination fuer alle Services - use_approximate_count Option fuer grosse Tabellen 2. Connection Pool erhoeht: - pool_size: 10 -> 20 - max_overflow: 20 -> 30 - 3 Engines = 150 Connections max (fuer 100+ User) 3. Statement Timeout (30s): - Verhindert dass langsame Queries die API blockieren - connect_args server_settings statement_timeout=30000 Tests: 43/43 bestanden
This commit is contained in:
+2
-2
@@ -27,8 +27,8 @@ class Settings(BaseSettings):
|
||||
auth_database_url: str = "" # Falls back to database_url if empty
|
||||
worker_database_url: str = "" # Falls back to database_url if empty
|
||||
migration_database_url: str = "" # Falls back to database_url if empty
|
||||
db_pool_size: int = 10
|
||||
db_max_overflow: int = 20
|
||||
db_pool_size: int = 20
|
||||
db_max_overflow: int = 30
|
||||
db_echo: bool = False
|
||||
|
||||
# Redis
|
||||
|
||||
Reference in New Issue
Block a user