This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://localhost:8888/?mode=sync | |
http://wikipedia.com code: 200 | |
http://google.com code: 200 | |
http://example.com code: 200 | |
#> time curl http://localhost:8888/\?mode\=sync | |
http://wikipedia.com code: 200<br/>http://google.com code: 200<br/>http://example.com code: 200curl http://localhost:8888/\?mode\=sync 0,01s user 0,00s system 0% cpu 1,106 total | |
# http://localhost:8888/?mode=async |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import socket | |
from tornado.web import Application as BaseApplication | |
from tornado.options import define, options, parse_command_line | |
class Application(BaseApplication): | |
def listen(self, port, address="", **kwargs): | |
if options.fd: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/circus/process.py b/circus/process.py | |
index 070cb10..f7cb699 100644 | |
--- a/circus/process.py | |
+++ b/circus/process.py | |
@@ -124,7 +124,7 @@ class Process(object): | |
if self.uid: | |
os.setuid(self.uid) | |
- self._worker = Popen(args, cwd=self.working_dir, | |
+ self._worker = Popen(args, bufsize=-1, cwd=self.working_dir, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/circus/process.py b/circus/process.py | |
index 070cb10..f7cb699 100644 | |
--- a/circus/process.py | |
+++ b/circus/process.py | |
@@ -124,7 +124,7 @@ class Process(object): | |
if self.uid: | |
os.setuid(self.uid) | |
- self._worker = Popen(args, cwd=self.working_dir, | |
+ self._worker = Popen(args, bufsize=-1, cwd=self.working_dir, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&> python hello_tornado.py & | |
&> boom http://localhost:8888 -c 100 -n 1000 | |
Server Software: TornadoServer/3.0.1 | |
Running GET http://127.0.0.1:8888 | |
Host: localhost | |
Running 1000 times per 100 workers. | |
Starting the load [====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[circus] | |
check_delay = 5 | |
endpoint = tcp://127.0.0.1:5555 | |
pubsub_endpoint = tcp://127.0.0.1:5556 | |
stats_endpoint = tcp://127.0.0.1:5557 | |
httpd = True | |
httpd_host = localhost | |
httpd_port = 8080 | |
[watcher:dummy] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import socket | |
import tornado.ioloop | |
import tornado.web | |
class MainHandler(tornado.web.RequestHandler): | |
def get(self): | |
self.write("Hello, world") | |
application = tornado.web.Application([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.ioloop | |
import tornado.web | |
class MainHandler(tornado.web.RequestHandler): | |
def get(self): | |
self.write("Hello, world") | |
application = tornado.web.Application([ | |
(r"/", MainHandler), | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true} | |
[u'test.1.1'] | |
[u'test.1.1'] | |
{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true} | |
[u'test.1.2'] | |
[u'test.1.2'] | |
{"ok":true,"acknowledged":true}% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from flask import Flask | |
app = Flask(__name__) | |
app.debug=True | |
@app.route("/hello") | |
def world(): | |
return "Hello world" | |
@app.route("/") |