Anyone know any solution?
Question too broad to answer with the information supplied. This is largely why you're not getting any answers
I have two options Game servers behind an specific port with load balacer like example.com:9000 or each game servers run on different ports anf using a range of ports example.com:9001 ... 10000 I don't know how load balace the udp traffic. and Which option is better ? **I need flexibility to increase and decrease servers numbers in specific times like 8am or 5pm
Ports and port configuration is largely irrelevant. If you're self hosting then nginx will do most of the time. On AWS you can use the Network Load Balancer. However, this all depends on the server side code.
the problem is nginx udp server listentin and loadbalancing and in the backend we have 2 game server run and in the nginx configuration this two servers configured. when the client connect to the nginx server it uses round robin method. and we have many problems. because we want every single player play in the one server not every packet round in two server. i searched about hash load balancing but not find any configuration example
The example in the nginx documentation is sufficient
how hash method works can send me any link that describe this method with detail
https://nginx.org/en/docs/ there's the official documentation. It's all in there, just need to read it
Hash – NGINX selects the server based on a user‑defined key, for example, the source IP address ($remote_addr): https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/
Обсуждают сегодня