转自: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.

a list of frequently asked questions about Circus的更多相关文章

  1. tmux frequently asked questions

    tmux frequently asked questions How is tmux different from GNU screen?     tmux and GNU screen have ...

  2. Relinking Oracle Home FAQ ( Frequently Asked Questions) (Doc ID 1467060.1)

    In this Document   Purpose   Questions and Answers   1)  What is relinking ?   2)  What is relinking ...

  3. Frequently Asked Questions

    转自:http://www.tornadoweb.org/en/stable/faq.html Frequently Asked Questions Why isn’t this example wi ...

  4. 06 Frequently Asked Questions (FAQ) 常见问题解答 (常见问题)

    Frequently Asked Questions (FAQ) Origins 起源 What is the purpose of the project? What is the history ...

  5. 成员函数指针 C++ FAQ LITE — Frequently Asked Questions

    http://www.sunistudio.com/cppfaq/pointers-to-members.html C++ FAQ LITE — Frequently Asked Questions ...

  6. openvswith Frequently Asked Questions

    Open vSwitch <http://openvswitch.org> 参考地址:http://git.openvswitch.org/cgi-bin/gitweb.cgi?p=ope ...

  7. Kafka Frequently Asked Questions

    This is intended to be an easy to understand FAQ on the topic of Kafka. One part is for beginners, o ...

  8. NFC Forum : Frequently Asked Questions (NFC 论坛:FAQ)

    NFC for Business What is the NFC Forum? The NFC Forum is a not-for-profit industry organization whos ...

  9. 工作笔记20170315-------关于FAQ(Frequently Asked Questions)列表的代码

    源自于:http://www.17sucai.com/pins/3288.html (1)FAQ问答列表点击展开收缩文字列表 <ul>   <li class="clear ...

随机推荐

  1. Android apk逆向:反编译,回编译,签名,打包。

    Android apk逆向:反编译,回编译,签名,打包流程. 第一步: apk 反编译. 1) 打开命令行窗口,输入java -version, 检测当前java版本,若版本较低, 则下载JAVA S ...

  2. Java jms学习

    /** * <html> * <body> * <P> https://github.com/Jasonandy </p> * <p> Al ...

  3. JVM性能优化--Java的垃圾回收机制

    一.Java内存结构 1.Java堆(Java Heap) java堆是java虚拟机所管理的内存中最大的一块,是被所有线程共享的一块内存区域,在虚拟机启动时创建.此内存区域的唯一目的就是存放对象实例 ...

  4. 2019 钢银java面试笔试题 (含面试题解析)

    本人3年开发经验.18年年底开始跑路找工作,在互联网寒冬下成功拿到阿里巴巴.今日头条. 钢银等公司offer,岗位是Java后端开发,最终选择去了 钢银. 面试了很多家公司,感觉大部分公司考察的点都差 ...

  5. 2019 咪咕文化java面试笔试题 (含面试题解析)

    本人3年开发经验.18年年底开始跑路找工作,在互联网寒冬下成功拿到阿里巴巴.今日头条.咪咕文化等公司offer,岗位是Java后端开发,最终选择去了咪咕文化. 面试了很多家公司,感觉大部分公司考察的点 ...

  6. 30个关于Shell脚本的经典案例(下)

    本文目录 21.从FTP服务器下载文件 22.连续输入5个100以内的数字,统计和.最小和最大 23.将结果分别赋值给变量 24.批量修改文件名 25.统计当前目录中以.html结尾的文件总大 26. ...

  7. k8s--yml文件

  8. Linux排查PHP-FPM进程过量常用命令

    命令如下: 查看每个PHP-FPM进程的内存占用:ps -ylC php-fpm –sort:rss 查看消耗内存最多的前 40 个进程:ps auxw|head -1;ps auxw|sort -r ...

  9. Java 之 Jedis

    一.客户端 Jedis 1.Jedis Jedis 是一款java操作 redis 数据库的工具. 2.使用步骤 (1)下载 Jedis 的 jar 包 (2)使用: //1. 获取连接 Jedis ...

  10. ffmpeg 把视频转换为图片

    ffmpeg -i "Tail of Hope.mp4" -r 1 -q:v 2 -f image2 pic-%03d.jpeg