throttle icon indicating copy to clipboard operation
throttle copied to clipboard

Can't get it to work via Node.JS running within a container

Open gdollard opened this issue 2 years ago • 5 comments

Hi, I am invoking throttle.start & stop directly in my Node.JS code. We then build an image of this (based on sitespeed.io:26.1.0) and pass a config.json file with all the various configuration for sitespeed (browsertime, connectivity, engine etc).

However, when I run the image and invoke my test function I get the following error:

ERROR: [browsertime] Error In My Test Scenario Error: Command failed: sudo ip link set dev ifb0 up sitespeed-scenario | Cannot find device "ifb0"

I am running this on Mac.

I am able to run throttle with no problem when invoking the package directly from my global module but not when running in a container.

I noticed some settings needed when running the container on Linux (https://www.sitespeed.io/documentation/throttle/#run-in-docker-on-linux) but is there similar support for Mac?

I'd appreciate some info on this, thanks folks.

gdollard avatar Feb 21 '23 12:02 gdollard

Hi @gdollard there's limitations on running Docker on Mac, since they use different systems throttling connection. What you can do, is use throttle outside of your container:

  • throttle
  • start the container, run the tests
  • remove the throttling

soulgalore avatar Feb 21 '23 12:02 soulgalore

thanks @soulgalore for the reply. Yes, I had a feeling there were limitations with the Mac (as documented on the sitespeed docs). My problem with throttling outside of the container is whether I can do it or now because our built container will be managed by K8S so I am not even sure if I'd be able to set the throttling from there. I need to investigate further!

Thanks for your prompt response.

gdollard avatar Feb 21 '23 12:02 gdollard

Hi @gdollard another thing is that you cannot throttle the connection on K8S , you need to have access to the actual machine, so I would propose running the image somewhere else.

soulgalore avatar Feb 21 '23 14:02 soulgalore

ah right, thanks for that info.

gdollard avatar Feb 21 '23 14:02 gdollard

There's some more information https://www.sitespeed.io/documentation/sitespeed.io/web-performance-testing-in-practice/#servers about choosing servers and where to run the tests. There's a little bit outdated documentation, I will try to update it the coming weeks.

soulgalore avatar Feb 21 '23 15:02 soulgalore