Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mathieu Lecarme <mathieu.lecarme@af83.com>
- Loading branch information
Mathieu Lecarme
committed
Jan 15, 2012
1 parent
680cc36
commit 7f3223f
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Triangle example | ||
================ | ||
|
||
The front is a http server. Each web request is sent to a queue. | ||
workers pick tasks from the queue and answer to the right http connection. | ||
|
||
Big picture | ||
----------- | ||
|
||
``` | ||
redis | ||
http +-------+ +-------+ lpoll +---------+ | ||
<------>| |------->| Queue |<-------| | | ||
| Front | +-------+ | Workers | | ||
| |<------------------------| | | ||
+-------+ +---------+ | ||
``` | ||
|
||
Try it | ||
------ | ||
|
||
In a first terminal: | ||
|
||
node front.js | ||
|
||
In a second terminal: | ||
|
||
node worker.js & node worker.js & node worker.js & node worker.js | ||
|
||
In a third terminal: | ||
|
||
siege -c 100 -t 30s http://localhost:1337 |