Frequently Asked Questions — Circus 0.15.0 documentation https://circus.readthedocs.io/en/latest/faq/#whycircussockets

Here is a list of frequently asked questions about 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.

How does Circus stack compare to a classical stack?的更多相关文章

  1. [Swift]堆栈Stack的两种版本:(1)用类包装Stack (2)用泛型包装Stack

    堆栈是一个在计算机科学中经常使用的抽象数据类型.堆栈中的物体具有一个特性: 最后一个放入堆栈中的物体总是被最先拿出来, 这个特性通常称为后进先出(LIFO)队列. 堆栈中定义了一些操作. 两个最重要的 ...

  2. a list of frequently asked questions about Circus

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

  3. Stack Overflow: The Architecture - 2016 Edition

    To get an idea of what all of this stuff “does,” let me start off with an update on the average day ...

  4. STL--容器适配器(queue、priority_queue、stack)

    适配器(Adaptor)是提供接口映射的模板类.适配器基于其他类来实现新的功能,成员函数可以被添加.隐藏,也可合并以得到新的功能. STL提供了三个容器适配器:queue.priority_queue ...

  5. leetcode 155. Min Stack --------- java

    Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. pu ...

  6. Java类集 List, Set, Map, Stack, Properties基本使用

    首先看下继承结构: ArrayList(常用): /** * List接口继承Collection接口 * ArrayList, Vector为List接口的实现类 * add()添加新元素,remo ...

  7. 对Android中的堆栈的理解(Stack)

      版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/Ln_ZooFa/article/details/50337529 堆栈空间分配 栈(操作系统): ...

  8. 数据结构设计 Stack Queue

    之前在简书上初步总结过几个有关栈和队列的数据结构设计的题目.http://www.jianshu.com/p/d43f93661631 1.线性数据结构 Array Stack Queue Hash ...

  9. Coursera Algorithms week2 栈和队列 练习测验: Stack with max

    题目原文: Stack with max. Create a data structure that efficiently supports the stack operations (push a ...

随机推荐

  1. 【进程/作业管理】篇章二:Linux系统作业控制(jobs)

    作业:jobs 分类: 前台作业(foregroud):通过终端启动,且启动后会一直占据终端 后台作业(backgroud):可以通过终端启动,但启动后即转入后台运行(释放终端) 如何让作业运行于后台 ...

  2. (九)rmdir和rm -r删除目录命令

    一.命令描述与格式 rmdir用于删除空目录 命令格式 :rmdir   [选项]   目录名 选项: --ignore-fail-on-non-empty   :忽略任何因目录仍有数据而造成的错误 ...

  3. 神奇的 SQL 之擦肩而过 → 真的用到索引了吗

    开心一刻 今天下班,骑着青桔电动车高高兴兴的哼着曲回家,感觉整个世界都是我的 刚到家门口,还未下车,老妈就气冲冲的走过来对我说道:"你表哥就比你大一岁,人家都买了奔驰了,50 多万!&quo ...

  4. [leetcode]103. Binary Tree Zigzag Level Order Traversal二叉树Z字形层序遍历

    相对于102题,稍微改变下方法就行 迭代方法: 在102题的基础上,加上一个变量来判断是不是需要反转 反转的话,当前list在for循环结束后用collection的反转方法就可以实现反转 递归方法: ...

  5. Redis集群搭建采坑总结

    背景 先澄清一下,整个过程问题都不是我解决的,我在里面就是起了个打酱油的角色.因为实际上我负责这个项目,整个过程也比较清楚.之前也跟具体负责的同事说过,等过段时间带他做做项目复盘.结果一直忙,之前做的 ...

  6. LVS之2---基于LVS负载均衡集群架构

    LVS之2---基于LVS负载均衡集群架构实现 目录 LVS之2---基于LVS负载均衡集群架构实现 ipvsadm software package Options 常用命令 保存及重载规则 内存映 ...

  7. 第四章节 BJROBOT 线速度校正 【ROS全开源阿克曼转向智能网联无人驾驶车】

    BJROBOT 线速度校正   1.把小车平放在地板上,用卷尺作为测量刻度,选取车头或者车尾处作为小车的起点, 打开资料里的虚拟机,打开一个终端 ssh 过去主控端启动 roslaunch znjro ...

  8. Flask 操作Mysql数据库 - flask-sqlalchemy扩展

    数据库的设置 Web应用中普遍使用的是关系模型的数据库,关系型数据库把所有的数据都存储在表中,表用来给应用的实体建模,表的列数是固定的,行数是可变的.它使用结构化的查询语言.关系型数据库的列定义了表中 ...

  9. skynet游戏服务器框架分享

    分享下我之前做的服务器框架;  游戏在线最高3万;  物理机I7的3台阿里云分服;性能及其强劲; 框架: 底层基于比较流行的skynet,基础采用c语言,脚本lua,部分服务golang; Skyne ...

  10. LInux之Shell工具:Cut、Sed、Awk、Sort

    一. cut cut的工作就是"剪",具体的说就是在文件中负责剪切数据用的.cut 命令从文件的每一行剪切字节.字符和字段并将这些字节.字符和字段输出. 1.基本用法 cut [选 ...