Spaces:
Running
Running
Commit History
-
main - Approximate real RAM usage and shrink the oversized alerts panel
RAM reading subtracted nothing from cgroup v2's memory.current, which includes reclaimable file cache (image/video downloads, mmap'd model weights) — inflating the number shown vs what's actually pinned. Subtract inactive_file from memory.stat, matching the "working set" calculation Docker/Kubernetes use. Also stopped the alerts panel from flex-growing to fill the whole remaining page height; it now caps at 200px like a normal compact panel.f20adc7
-
main - Give workers stable names instead of raw pids
Pids change on every restart, making it hard to tell workers apart across deploys or to notice a specific one crash-looping. Each worker now claims a name ("Worker A", "Worker B", ...) from a small shared file the first time it starts, keeps it for its whole lifetime, and never reuses a name for a different pid — so a restart shows up as a new name appearing while the old one's alert fades out. Alerts and worker cards use the name; the pid is still available as a tooltip on the card.46ea438 -
main - Replace log panel with 5-min health stats and anomaly alerts
Raw log tailing on the monitoring page duplicated HF's own log viewer and wrote every log line to disk per worker for no real benefit. Removed that entirely (_FileLogHandler, _trim_log_files, get_log_lines, /logs) and replaced it with per-worker in-process instrumentation: a rolling 5-minute window of per-image latency/success and cache evictions, aggregated into throughput/error-rate/latency health stats and four anomaly alerts (worker not reporting, RSS spike past the cache warm-up grace period, cache thrashing, error-rate spike). All aggregation stays local per worker and piggybacks on the existing 5s stats-reporter tick, so it adds negligible overhead. Also dropped the dead `Model` import and unused `os` import in main.py.3200602 -
main - Match HF's log viewer typography: system monospace, near-white text
Own log panel felt visually noisier than HF's native container log view. Switch to a system monospace stack, more line-height, and a single bright near-white for normal lines instead of a dimmer secondary-ink tone, keeping color reserved for warning/error only.0018b11 -
main - Enlarge the log panel, deepen its buffer, and fix log text colors
Log box was a fixed 220px showing only the last 100 merged lines refreshed every 5s, so busy bursts wiped it before anyone could read it and it felt sluggish next to HF's own log viewer. Let it flex to fill the page, request 400 lines on a 2s poll, and raise the per-worker file cap to 1000 lines so there's enough headroom. Also replaced the ad-hoc log text colors with the validated dark-mode status palette (critical/warning) plus a proper secondary-ink token for normal lines instead of a stray blue-gray.dfdf3ba -
main - Replace SSE proxy with simple log polling, rewrite JS as ES5 for HF iframe compat
4139463 -
main - Fix SSE reconnect loop: catch errors, set retry 60s, return HTTP status on failure
e2aaf7c -
main - Defensive stats render and handle HF SSE event types for log stream
9f11300 -
main - Embed real-time HF container logs via SSE proxy on monitoring page
6366908 -
main - Increase image cache to 500 and malloc trim interval to 15 minutes
87397d6 -
main - Fix req counter layout: separate RSS and unit/req onto distinct lines
be6946a -
main - Increase request counter font size and brightness
60b28cb -
main - Brighten request counter text colour for legibility
191d371 -
main - Move RAM/CPU into header meta line, remove dedicated machine bar
15bea90 -
main - Fix RSS bar visibility: explicit colour and increase track height
41a7107 -
main - Add request counter per worker and replace cache bar with RSS bar
Track _request_count per worker in check_similarity(); expose via get_memory_stats(). Cards now show RSS bar (relative to heaviest worker = 100%) coloured with the same green/amber/red as the RSS value, plus request count. Cache count stays as text in the card top-right.d39ee38 -
main - Reduce machine stats bar height
20bbae3 -
main - Add machine RAM and CPU stats bar to monitoring page
Add get_machine_stats() using psutil.virtual_memory() and cpu_percent(). Show as a compact two-bar row (RAM and CPU with colour-coded progress) between the header and the worker cards. Warm up cpu_percent() at module load to avoid the first-call zero reading.416ab0a -
main - Revert to card grid, remove logs section, fix colours
Remove log section and row layout. Cards back with top colour border, bright RSS colours (#4ade80 / #fbbf24 / #f87171), compact sizing (~85px tall) to fit above HF logs panel. Header on one line to save vertical space. JS polls /stats every 5s.0eb29b9 -
main - Fix log capture across all workers and improve text contrast
Replace in-memory per-process log buffer with file-based handler writing to /tmp/similarity_logs/{pid}.log; get_log_lines() aggregates across all worker files so logs from every process are visible. Add _trim_log_files() to the periodic trimmer. Brighten log text colours (msg #cbd5e1, ts #64748b, info #60a5fa) and worker label colours (#94a3b8).29f1059 -
main - Compact worker rows, add live log section to monitoring page
Replace card grid with compact single-line rows (border-left colour coded, inline cache progress and RSS). Add in-memory log buffer (_MemHandler) and /stats JSON endpoint; page polls every 5s and renders logs directly below the workers panel. Fixes illegible PID colour and oversized cards that clashed with HF Logs panel.2d70896 -
main - Reduce workers to 8, increase cache to 300, redesign monitoring page
Remove /health endpoint and per-request MEM log; monitoring is now internal only via background reporter. Root page redesigned with card grid, colour-coded RSS (green/amber/red), cache progress bars and server-side rendering with meta-refresh.5bd83d8
-
main - Mitigate glibc malloc fragmentation from cumulative image throughput
RSS kept climbing per worker even after the image cache saturated at its 200-entry cap, well past what the cached array sizes justify -- classic glibc arena/mmap-threshold fragmentation from repeated decode/resize allocations on varied image sizes. Cap arena count via MALLOC_ARENA_MAX and periodically call malloc_trim(0) to hand freed memory back to the OS, without touching what images are accepted or how they're processed.1ad39c4 -
main - Report worker memory stats on a background timer, not only per-request
/health only showed workers that had already handled a request, so under light or unevenly balanced traffic some of the 10 workers never appeared. Each worker now writes its own stats every 5s from startup regardless of whether it receives any traffic.0a451cf -
main - Show all workers' memory stats together on the health endpoint
/health previously only reflected whichever worker handled that request, requiring several refreshes to see the full picture. Each worker now persists its stats to a shared file so /health and the root page can show all 10 workers at once.494f72d -
main - Add RSS memory logging and live worker stats on health/root endpoints
Needed to diagnose remaining unbounded memory growth after dd5dd8f: logs RSS per request in check_similarity and exposes it via /health, surfaced live on the root page for quick inspection.28d9db8
-
Update main.py
Verified signature390c90f
-
Update main.py
Verified signature045ac66
-
Update main.py
Verified signature42d6166 -
Update main.py
Verified signaturebc50817
-
Update main.py
Verified signaturef4ee29a -
Update main.py
Verified signaturefd91357
-
Create main.py
Verified signature9c36111