Amogh1221 commited on
Commit
28accab
Β·
verified Β·
1 Parent(s): 7953192

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -125,7 +125,8 @@ _ENGINE_IO_LOCK = asyncio.Lock()
125
 
126
  def _engine_hash_mb() -> int:
127
  try:
128
- v = int(os.environ.get("ENGINE_HASH_MB", "128"))
 
129
  except ValueError:
130
  v = 128
131
  return max(8, min(512, v))
@@ -261,7 +262,7 @@ async def _engine_call(engine, coro, timeout_sec: float):
261
 
262
 
263
  # ─── Background Memory Cleanup Task ───────────────────────────────────────────
264
- _RAM_CLEANUP_THRESHOLD_MB = float(os.environ.get("RAM_CLEANUP_THRESHOLD_MB", "400"))
265
  _RAM_CLEANUP_INTERVAL_SEC = int(os.environ.get("RAM_CLEANUP_INTERVAL_SEC", "300"))
266
 
267
  async def memory_cleanup_task():
 
125
 
126
  def _engine_hash_mb() -> int:
127
  try:
128
+ # Default kept conservative to prevent hash table blowups on small VMs.
129
+ v = int(os.environ.get("ENGINE_HASH_MB", "32"))
130
  except ValueError:
131
  v = 128
132
  return max(8, min(512, v))
 
262
 
263
 
264
  # ─── Background Memory Cleanup Task ───────────────────────────────────────────
265
+ _RAM_CLEANUP_THRESHOLD_MB = float(os.environ.get("RAM_CLEANUP_THRESHOLD_MB", "300"))
266
  _RAM_CLEANUP_INTERVAL_SEC = int(os.environ.get("RAM_CLEANUP_INTERVAL_SEC", "300"))
267
 
268
  async def memory_cleanup_task():