gunicorn + nginx: Server via socket or proxy?

后端 未结 5 1248
春和景丽
春和景丽 2021-01-30 08:46

I\'ve seen two strategies for hosting a django application with gunicorn and nginx.

One strategy is to run gunicorn on a network port. For example (from http://goodcode

5条回答
  •  囚心锁ツ
    2021-01-30 09:21

    Here are the results of my test TCP Proxy via Unix socket:

    Setup: nginx + gunicorn + django running on 4 m4.xlarge nodes on AWS.

    1 million of requests are made over about 30 minute window:

    one instance is at 100% and 3 others are all 70% CPU because of app internal load distribution.

    TCP vs. socket is virtually identical

    Timing for making 1000000 requests

    is 27 minutes for TCP proxy

    and 31 minutes for the unix socket.

    In this particular setup no unix socket performance advantage.

提交回复
热议问题