eloukas commited on
Commit
414a2e9
·
verified ·
1 Parent(s): 350edf7

Optimize deployment with shared memory between threads instead of new workers

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -1
Dockerfile CHANGED
@@ -12,7 +12,11 @@ COPY --chown=user . .
12
 
13
  EXPOSE 7860
14
 
15
- CMD ["gunicorn", "app:server", "--bind", "0.0.0.0:7860", "--workers", "4"]
 
 
 
 
16
 
17
  # Option 1: Point directly to the Dash app's server. -- does not work for hf spaces
18
  # CMD ["gunicorn", "app:app.server", "--bind", "0.0.0.0:7860", "--workers", "4"]
 
12
 
13
  EXPOSE 7860
14
 
15
+ # Optimization: Baseline
16
+ # CMD ["gunicorn", "app:server", "--bind", "0.0.0.0:7860", "--workers", "4"]
17
+
18
+ # Optimization: Shared memory with many threads
19
+ CMD ["gunicorn", "app:server", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "4", "--timeout", "120"]
20
 
21
  # Option 1: Point directly to the Dash app's server. -- does not work for hf spaces
22
  # CMD ["gunicorn", "app:app.server", "--bind", "0.0.0.0:7860", "--workers", "4"]