Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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;
}
}
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ services:
- opencopilot-net
env_file:
- llm-server/.env
ports:
- 8002:8002
- 5678:5678
itssubhodiproy marked this conversation as resolved.
Show resolved Hide resolved
deploy:
replicas: 3 # Increased number of replicas
depends_on:
mysql:
condition: service_healthy
Expand Down