如何使用NGINX将用户路由到特定计算机?

编程入门 行业动态 更新时间:2024-10-24 21:29:15
本文介绍了如何使用NGINX将用户路由到特定计算机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我最近从Figma工程博客中阅读了这篇文章: www.figma/blog/rust-in-production-at-figma/,并对他们的NGINX多人路由设置感到好奇.看起来是这样的:

I was recently reading this article from the Figma engineering blog: www.figma/blog/rust-in-production-at-figma/ and was curious about their NGINX setup for multiplayer routing. This is how it looks:

其中有M台服务器,每台服务器有W台工作者. Figma允许用户实时在设计文档上进行协作,并且每个文档(即负责每个文档的实时多人处理的逻辑)始终位于一个特定的工作人员中.

Where they have M number of servers, and where each server has W number of workers. Figma lets users collaborate on design documents in real-time, and each document (i.e. the logic that takes care of the real-time multiplayer processing for each doc) always lives in one specific worker.

我想知道他们如何设法始终将用户路由到具有正在处理文档的工作程序的计算机,然后再路由到实际具有该文档的特定进程.

I’m wondering how they manage to always route users to the machine that has the worker for the document being worked on, and then to the specific process that actually has the doc.

他们使用NGINX进行此操作,但是我的问题是如何?

They do this with NGINX, but my question is how?

我知道NGINX具有轮循和ip_hash方法来实现负载平衡,但这还不足以实现它们的功能.

I know that NGINX has round-robin and ip_hash methods to load balance, but that’s not granular enough to achieve what they do.

相关问题: 根据条件将流量路由到多个节点服务器

推荐答案

您应该能够使用Cookie将用户与下游节点相关联: docs.nginx/nginx/admin-guide/load-balancer/http -load-balancer/#enabling-session-persistence

You should be able to use a cookie to associate a user with the downstream node: docs.nginx/nginx/admin-guide/load-balancer/http-load-balancer/#enabling-session-persistence

更多推荐

如何使用NGINX将用户路由到特定计算机?

本文发布于:2023-11-11 10:28:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578166.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路由   如何使用   计算机   用户   NGINX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!