I spent most of yesterday diagnosing timeouts in the http-request node.... and tracked them down to packet loss as packets leave my ISPs network -
i.e. if I request against one of THEIR servers, all is ok, but if I request against other internet servers, I get far too many failures for comfort.
(and I tested with wget to exclude NR or node.js or any libraries as the cause, and from linux as well as windows).
So I was wondering what an acceptable level of packet loss resulting in http request timeout was generally;
The below flow repeatedly requests
http://www.example.com, and once per second emits a debug of the count so far.
If the http-request node gets a connection timeout (or other error), the flow will stop and emit the msg from the http request node.
It would be interesting for me to hear the average of a few runs in terms of the maximum count achieved, and the ISP you are on.
Would be good to see results from some corporate lans....
If you get a chance to quickly test, please post back here with:
the count where is stops,
your ISP,
the url you tested against,
and if the site was considered to be within your ISPs network or outside of it.
thanks,
Simon
p.s. if you want to STOP the flow, disconnect a wire and deploy. I'm not sure if deploy SHOULD stop such a flow, but it stops only sometimes for me (0.17 branch) (maybe a bug in NR http request node close?).
p.p.s. you may want to run against a different (random) server rather than the one in the flow; could soliciting people to request hundreds of times from multiple places be classed as inciting DoS?
[
{
"id": "3b7d8b80.234a14",
"type": "http request",
"z": "47b3725c.2a535c",
"name": "",
"method": "GET",
"ret": "txt",
"tls": "",
"x": 450,
"y": 100,
"wires": [
[
"925c7db3.93ba4"
]
]
},
{
"id": "4b8ff552.64e4ec",
"type": "inject",
"z": "47b3725c.2a535c",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 120,
"y": 60,
"wires": [
[
"ef4ad503.62f3d8"
]
]
},
{
"id": "925c7db3.93ba4",
"type": "function",
"z": "47b3725c.2a535c",
"name": "",
"func": "context.count = context.count || 0;\n\nif (msg.cmd === 'init'){\n context.count = 0;\n}\n\nif (msg.statusCode !== 200){\n node.send([null, msg]);\n return;\n}\n\ncontext.count++;\n\nvar newmsg = {payload:'trigger'};\n\nsetTimeout(function(){\n node.send([newmsg, {payload:'success ' + context.count}]);\n}, 0);\n\nreturn;",
"outputs": "2",
"noerr": 0,
"x": 423.9999694824219,
"y": 225.8203067779541,
"wires": [
[
"3b7d8b80.234a14"
],
[
"2de38359.c5101c"
]
]
},
{
"id": "e38278e.9cfe988",
"type": "debug",
"z": "47b3725c.2a535c",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 870,
"y": 240,
"wires": []
},
{
"id": "ef4ad503.62f3d8",
"type": "change",
"z": "47b3725c.2a535c",
"name": "",
"rules": [
{
"t": "set",
"p": "cmd",
"pt": "msg",
"to": "init",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 190,
"y": 120,
"wires": [
[
"3b7d8b80.234a14"
]
]
},
{
"id": "2de38359.c5101c",
"type": "delay",
"z": "47b3725c.2a535c",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 610,
"y": 240,
"wires": [
[
"e38278e.9cfe988"
]
]
}
]