You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(apps): cut idle database load from app workers, host tables and live revisions #659
Several loops hit the database while nothing changes.
readAppHostTables loads full proxy host summaries only to collect ids (web/src/server/AppRuntime/ui/host-table.server.ts:60-65). Each open host table repeats it every 20 s.
The app operation worker runs every second (web/src/server/AppRuntime/operations.server.ts:66) and takes lockProxyRuntimeSettings (an upsert plus a row lock, web/src/server/ProxyRuntime/proxy-runtime-settings.ts:62-72) before it checks whether any operation is open (operations.server.ts:365-388). That lock competes with proxy host and settings edits.
The proxy-hosts live revision is sampled every 2 s per websocket subscription (web/src/config/realtime.config.ts:31, web/src/server/WebSockets/realtimeSubscriptions.ts:180), and every application change triggers sampleAll (web/src/server/WebSockets/realtimeWebSocket.ts:220).
App event streams poll once per second while idle (web/src/server/AppRuntime/services.server.ts:138-157).
Proposal
Select only the ids the host table needs.
Check for open app operations without a lock first, and take the settings lock only when there is work.
Share one live revision sample per topic across all subscriptions, and sample only the topics an application change affects.
Follow-up: wake app event streams with LISTEN/NOTIFY instead of polling.
Acceptance
With no open operations and no changes, the worker takes no row locks.
N subscribers of the same topic cause one sample per interval, not N.
Activity