Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhead when started, but no functions enabled #4

Open
mlinnell opened this issue Feb 28, 2014 · 1 comment
Open

Overhead when started, but no functions enabled #4

mlinnell opened this issue Feb 28, 2014 · 1 comment

Comments

@mlinnell
Copy link

I'm observing an interesting situation where I start with the following filter:

tcp and (tcp.DstPort == 80 or tcp.SrcPort == 80)

We have an internal website (internal network, not localhost) that load time looks like this without Clumsy running (consistently over ~10 page loads):

DOMContentLoaded: 600ms
Load event fired: 700ms

However, if I click "start", but do not enable any functions (nothing is checked), that load time now looks like this (repeatable result):

DOMContentLoaded: 1,500ms
Load event fired: 6,500ms

The testing was done in Chrome, and the time was measure in the Network tab of Chroms dev tools. Now, if I enable lag for 20ms, the time reduces even further (as expected):

DOMContentLoaded: ~2,000ms
Load event fired: ~9,500ms

However, because of the overhead, this makes me wonder - does adding 20ms of lag really make my website take 2.5 seconds longer to load (e.g., if I had a real 20ms lag without clumsy running), or does Clumsy add some additional overhead as part of those 2.5 seconds (as evidenced by the fact that just running Clumsy, with nothing enabled, made a 600 ms request triple to ~1.5secs)

i.e. any TCP request on port 80 will always take 3 times longer just with clumsy running? And therefore a 20ms lag that added 2.5secs of load time would, in reality, only add 2.5 / 3 total seconds of load time?

So, I guess my question is this:

  • Should clumsy be adding overhead, even when no functions are enabled (but clumsy is still running)
@jagt
Copy link
Owner

jagt commented Mar 1, 2014

Hi mlinnell, thanks for your detailed report. Let me explain what I know about this:

clumsy does introduce overhead when it starts filtering. All packets will be captured and resend and it would definitely introduce overhead. I'm suppose it would be quite significant as we've intercept what should be done directly by the OS. When you've set the lag to 20ms, clumsy would further hold the packets a little bit longer. Let's assume the lag introduced by clumsy is like 40ms in your settings.

The first thing to notice is that in the filtering, you've included both inbound and outbound packets, this might doubled the latency. Then clumsy introduced is happening on per network packet, not per HTTP request. For example when a TCP connection is established, it needs three packets to establish the connection. Every packets sent is having a 40ms lag, then when the TCP connection get established it's already 40_3_2 = 240ms delay. Then for a web page to be DOM ready, some requests needs to be done synchronized, ie in a particular order. Say we have three requests that needs to be get in order, then the delay triples to 240*3 = 720ms.

This is quite back of the envelope calculation, the gist is that you can't treat the parameters in clumsy as an accurate measure (in other words I'm not good enough to make it accurate 😄 ). It guarantee the enabled functions would happen and the parameters are used to control it. You shouldn't take the numbers in clumsy seriously.

Hope this helps. I'll update this to the manual page later. Thanks again for your feedback.

(edited: fix the wrong calculations)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants