Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Feiox
V2EX  ›  Linux

Linux 下如何在 API 层面上进行负载均衡?

  •  
  •   Feiox ·
    feiox · Jun 4, 2015 · 3497 views
    This topic created in 4021 days ago, the information mentioned may be changed or developed.

    不要太重型的武器 ~
    就是类似以下这种:

    • POST /user -> server01
    • GET /user/1001 -> server02

    最好是效率好点的,如果一般的解决,写个 Flask 手工转发一下也可以。
    使用 Nginx 可以吗?
    如果使用 Node.js 或者 Tornade with PyPy 是不是效率损失很小?

    6 replies    2015-06-04 15:17:00 +08:00
    liwei
        1
    liwei  
       Jun 4, 2015
    这跟Linux有什么关系
    wy315700
        2
    wy315700  
       Jun 4, 2015
    nginx
    haproxy
    bjzhush
        3
    bjzhush  
       Jun 4, 2015
    nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP proxy server, originally written by Igor Sysoev.
    ---摘自 http://nginx.org/en/
    024680
        4
    024680  
       Jun 4, 2015
    使用Nginx就可以了,定义location即可
    DjvuLee
        5
    DjvuLee  
       Jun 4, 2015
    我感觉楼主提到的东西和你要解决的问题不沾边了。

    nginx和haproxy都可以的。
    wdlth
        6
    wdlth  
       Jun 4, 2015
    Squid、Nginx、HAProxy、Varnish、ATS,很多反向代理都能做到这样。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2754 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 11:36 · PVG 19:36 · LAX 04:36 · JFK 07:36
    ♥ Do have faith in what you're doing.