转自:https://circus.readthedocs.io/en/latest/faq/,可以帮助我们了解circus 的使用,以及问题解决

How does Circus stack compare to a classical stack?

In a classical WSGI stack, you have a server like Gunicorn that serves on a port or an unix socket and is usually deployed behind a web server like Nginx:

Clients call Nginx, which reverse proxies all the calls to Gunicorn.

If you want to make sure the Gunicorn process stays up and running, you have to use a program like Supervisord or upstart.

Gunicorn in turn watches for its processes (“workers”).

In other words you are using two levels of process managment. One that you manage and control (supervisord), and a second one that you have to manage in a different UI, with a different philosophy and less control over what’s going on (the wsgi server’s one)

This is true for Gunicorn and most multi-processes WSGI servers out there I know about. uWsgi is a bit different as it offers plethoras of options.

But if you want to add a Redis server in your stack, you will end up with managing your stack processes in two different places.

Circus’ approach on this is to manage processes and sockets.

A Circus stack can look like this:

So, like Gunicorn, Circus is able to bind a socket that will be proxied by Nginx. Circus doesn’t deal with the requests but simply binds the socket. It’s then up to a web worker process to accept connections on the socket and do the work.

It provides equivalent features than Supervisord but will also let you manage all processes at the same level, whether they are web workers or Redis or whatever. Adding a new web worker is done exactly like adding a new Redis process.

Benches

We did a few benches to compare Circus & Chaussette with Gunicorn. To summarize, Circus is not adding any overhead and you can pick up many different backends for your web workers.

See:

How to troubleshoot Circus?

By default, circusd keeps its logging to stdout rather sparse. This lack of output can make things hard to troubleshoot when processes seem to be having trouble starting.

To increase the logging circusd provides, try increasing the log level. To see the available log levels just use the –helpflag.

$ circus --log-level debug test.ini

One word of warning. If a process is flapping and the debug log level is turned on, you will see messages for each start attempt. It might be helpful to configure the app that is flapping to use a warmup_delay to slow down the messages to a manageable pace.

[watcher:webapp]
cmd = python -m myapp.wsgi
warmup_delay = 5

By default, stdout and stderr are captured by the circusd process. If you are testing your config and want to see the output in line with the circusd output, you can configure your watcher to use the StdoutStream class.

[watcher:webapp]
cmd = python -m myapp.wsgi
stdout_stream.class = StdoutStream
stderr_stream.class = StdoutStream

If your application is producing a traceback or error when it is trying to start up you should be able to see it in the output.

最新文章

  1. 如何查看、修改Linux的系统时间
  2. Atitit 电子商务订单号码算法(java c# php js 微信
  3. forward内部跳转 和redirect重定向跳转的区别
  4. jquery stop( ) 的用法 (转)
  5. TinyXML:一个优秀的C++ XML解析器
  6. nginx:配置详细说明
  7. [INS-41112] Specified network interface doesnt maintain connectivi
  8. 【LeetCode 236】Lowest Common Ancestor of a Binary Tree
  9. WPF 控件截图位置不正确的问题
  10. armeabi与armeabi-v7a
  11. sharepoint 2013 自定义列表eventhandle权限控制
  12. 常见缓存算法和LRU的c++实现
  13. 预约会议sql
  14. 15. 迭代器模式(Iterator Pattern)
  15. JAVA方法中的参数用final来修饰的原因
  16. deconvolution layer parameter setting
  17. Lintcode: Heapify && Summary: Heap
  18. windows server 账号克隆
  19. Linux磁盘分区和挂载
  20. 在 C Level 用 dlopen 使用 第三方的 Shared Library (.so)

热门文章

  1. Vue的router-link标签
  2. 介绍ArcGIS中各种数据的打开方法——mdb(个人数据库)
  3. 1 matplotlib绘制折线图
  4. 接口的鉴权cookie、session和token
  5. ASP.NET SignalR 系列(二)之项目创建
  6. sqoop从mysql导数据到hive报错:Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  7. 仿EXCEL插件,智表ZCELL产品V1.7 版本发布,增加自定义右键菜单功能
  8. GO实现Cron解析和定时任务
  9. 申请软件著作权,wps显示代码行号功能
  10. 设置Linux 程序lib搜索目录