sitespeedio / throttle

Throttle your network connection [Linux/Mac OS X]
MIT License
335 stars 26 forks source link

Node exception on using throttle --profile 3gslow #14

Open RaghuveerAddagada opened 6 years ago

RaghuveerAddagada commented 6 years ago

throttle --profile 3gslow (node:21528) UnhandledPromiseRejectionWarning: Error: Command failed: sudo tc qdisc add dev ifb0 root handle 1:0 netem delay 100ms rate 400kbit What is "rate"? Usage: ... netem [ limit PACKETS ] [ delay TIME [ JITTER [CORRELATION]]] [ distribution {uniform|normal|pareto|paretonormal} ] [ drop PERCENT [CORRELATION]] [ corrupt PERCENT [CORRELATION]] [ duplicate PERCENT [CORRELATION]] [ reorder PRECENT [CORRELATION] [ gap DISTANCE ]]

at makeError (/usr/lib/node_modules/@sitespeed.io/throttle/node_modules/execa/index.js:172:9)
at Promise.all.then.arr (/usr/lib/node_modules/@sitespeed.io/throttle/node_modules/execa/index.js:277:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

(node:21528) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4) (node:21528) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

soulgalore commented 6 years ago

Hi @RaghuveerA thanks for the report! What NodeJS version are you using and what's your OS?

Thanks Peter

RaghuveerAddagada commented 6 years ago

node --version v8.11.2

lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.9 (Final) Release: 6.9 Codename: Final

soulgalore commented 6 years ago

Ok it seems then that netem is different on CentOS that Ubuntu, I've only tried it there since our Docker containers in sitespeed.io is ubuntu based (see rate). If you have time to track down how we can make it work on CentOS to that would be great!

Best Peter