Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

[Feat] Socket scale using ip-hash algo #643

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
6 changes: 5 additions & 1 deletion container_config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ http {
listen 80;

location /socket.io {
proxy_pass http://llm-server:8002/socket.io; # Replace "your-server-url" with your actual server URL
proxy_pass http://socket_servers/socket.io; # Replace "your-server-url" with your actual server URL
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
Expand Down Expand Up @@ -43,4 +43,8 @@ http {
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
}
upstream socket_servers {
ip_hash; # Use IP hash to ensure that the same client is always connected to the same server
server llm-server:8002;
}
}
4 changes: 2 additions & 2 deletions docker-compose.arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ services:
env_file:
- llm-server/.env
ports:
- 8002:8002
- 5678:5678
- 8002
- 5678
depends_on:
mysql:
condition: service_healthy
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ services:
env_file:
- llm-server/.env
ports:
- 8002:8002
- 5678:5678
- 8002
- 5678
itssubhodiproy marked this conversation as resolved.
Show resolved Hide resolved
depends_on:
mysql:
condition: service_healthy
Expand All @@ -39,7 +39,7 @@ services:
build:
context: ./llm-server
dockerfile: worker.Dockerfile
image: codebanesr/workers:latest # Add this line
image: codebanesr/workers:latest
deploy:
replicas: 1

Expand All @@ -62,7 +62,7 @@ services:
build:
context: ./dashboard
dockerfile: Dockerfile
image: codebanesr/dashboard:latest # Add this line
image: codebanesr/dashboard:latest
ports:
- 8000:8000
volumes:
Expand Down