Skip to content

Instantly share code, notes, and snippets.

@s3u
s3u / gist:2172744
Created March 23, 2012 16:55
Siege - IPC - 5 messages per req
~> siege -c 100 -t 2m http://localhost:3030
** SIEGE 2.70
** Preparing 100 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 3407277 hits
Availability: 100.00 %
Elapsed time: 119.73 secs
Data transferred: 38.99 MB
Response time: 0.00 secs
@s3u
s3u / gist:2172713
Created March 23, 2012 16:52
Sieje - no IPC
~> siege -c 100 -t 2m http://localhost:3030
** SIEGE 2.70
** Preparing 100 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 5094455 hits
Availability: 100.00 %
Elapsed time: 119.01 secs
Data transferred: 58.30 MB
Response time: 0.00 secs
@s3u
s3u / gist:2164855
Created March 22, 2012 21:51
ql.io-site app on Cloud Foundry - See chunk markers
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 22 Mar 2012 13:28:14 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Keep-Alive: timeout=20
X-Powered-By: ql.io/node.js v0.6.8
vary: accept-encoding
Transfer-Encoding: chunked
@s3u
s3u / gist:2164763
Created March 22, 2012 21:38
curl trace from cloudfoundry
~/cfapp$ curl -v http://cfapp.qlio.cloudfoundry.me/console
* About to connect() to cfapp.qlio.cloudfoundry.me port 80 (#0)
* Trying 192.168.77.128... connected
* Connected to cfapp.qlio.cloudfoundry.me (192.168.77.128) port 80 (#0)
> GET /console HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: cfapp.qlio.cloudfoundry.me
> Accept: */*
>
< HTTP/1.1 200 OK
@s3u
s3u / gist:2147268
Created March 21, 2012 14:19
Options to disable
var options = {
cluster: false,
port: process.env.VCAP_APP_PORT || 3000,
monPort: 3001,
config: cwd + '/config/dev.json',
tables: cwd + '/tables',
routes: cwd + '/routes',
xformers: cwd + '/config/xformers.json',
disableConsole: true,
disableQ: true,
@s3u
s3u / gist:2031587
Created March 13, 2012 21:05
io-fork-join-orch-algo
repeat while pending > 0
for each statement
if task represented by the statement has no dependencies
pending++;
execute the task
on completion
pending--;
notify dependencies to update met dependencies
repeat this algo
end
@s3u
s3u / io-fork-join2.js
Created March 13, 2012 20:28
IO fork/join more
var _ = require('underscore'),
http = require('http'),
URI = require('uri'),
async = require('async');
var sendReq = function (s, cb) {
// send a HTTP req, and pass error or result to the function arg
// content omitted for brevity
};
@s3u
s3u / io-fork-join
Created March 13, 2012 20:14
Fork/Join IO
var _ = require('underscore'),
http = require('http'),
URI = require('uri'),
async = require('async');
var sendReq = function (s, cb) {
// send a HTTP req, and pass error or result to the function arg
// content omitted for brevity
};
@s3u
s3u / gist:1886996
Created February 22, 2012 20:22
Making Peace - route
resp = insert into ebay.trading.placeoffer (siteId, itemId, offer, action, quantity)
values ("{siteId}", "{itemId}", "{offer}", "{action}", "{quantity}");
return resp via route
"/offers" using method post;
@s3u
s3u / gist:1886988
Created February 22, 2012 20:21
Making Peace - body
<?xml version="1.0" encoding="utf-8"?>
<PlaceOfferRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<ErrorLanguage>en_US</ErrorLanguage>
{{#params}}
<ItemID>{{itemId}}</ItemID>
{{/params}}
{{#params}}
<EndUserIP>{{remoteAddress}}</EndUserIP>
{{/params}}
<Offer>