简体   繁体   English

Python [Django] + Uwsgi设置揭秘

[英]Python[Django] + Uwsgi settings demystified

There are quite a few settings in uwsgi (emperor mode) that I don't quite understand what the actual usage are and advantages, let alone setting the correct values. 在uwsgi(emperor模式)中有很多设置,我不太明白实际用法和优点,更不用说设置正确的值了。

they are: 他们是:

  • signal-bufsize 信号BUFSIZE
  • buffer-size 缓冲区大小
  • sharedarea sharedarea

I have tried reading the documentation eg. 我试过阅读文档,例如。 http://uwsgi-docs.readthedocs.org/en/latest/SharedArea.html but I still struggle to truly understand. http://uwsgi-docs.readthedocs.org/en/latest/SharedArea.html但我仍然很难真正理解。

Please can someone explain those 3 settings, and how I can work out the correct values for them? 请有人解释这3个设置,以及我如何计算出正确的值?

Some more background, I host quite a few different django projects, but all of them are isolated which means they don't really need to know each other, do those settings actually have any use in my scenario? 还有一些背景,我主持了很多不同的django项目,但是它们都是孤立的,这意味着它们并不需要彼此了解,这些设置在我的场景中是否真的有用?

I've worked with a very large scale uWSGI emperor installation with thousands of vassals. 我曾与一个非常大规模的uWSGI皇帝安装工作,成千上万的附庸。 We had to adjust buffer-size but not sharedarea or signal-bufsize. 我们必须调整缓冲区大小,但不能调整sharedarea或signal-bufsize。

  • sharedarea is for inter worker communication. sharedarea用于工人间沟通。 ie: inter process communication. 即:进程间通信。 But it is very low level. 但它的水平很低。 Literally sharing memory pages. 直译共享内存页面。
  • buffer-size is the amount of memory uWSGI allocates to store the request headers in while it is processing the request. buffer-size是uWSGI在处理请求时分配用于存储请求标头的内存量。 If you are storing large amounts of data as cookies then the default can be too small. 如果您将大量数据存储为cookie,则默认值可能太小。
  • signal-bufsize This one I'm not really sure about. signal-bufsize这个我不太确定。 It's never been clear to me what signals we are talking about here and I've never had to change it. 从来没有人清楚我们在这里谈论的是什么信号,我从来没有必要改变它。 But from reading this mailing list thread ( http://lists.unbit.it/pipermail/uwsgi/2013-November/006629.html ) it looks like it is the buffer used when communicating with mule processes. 但是从阅读这个邮件列表线程( http://lists.unbit.it/pipermail/uwsgi/2013-November/006629.html )看起来它是与mule进程通信时使用的缓冲区。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM