Flent-users discussion archives
 help / color / mirror / Atom feed
From: Shashank D <notifications@github.com>
To: tohojo/flent <flent@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [Flent-users] [tohojo/flent] ss_iterate.sh unnecessarily runs  for a long time (#236)
Date: Wed, 08 Sep 2021 09:18:11 -0700	[thread overview]
Message-ID: <tohojo/flent/issues/236@github.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]

I tried running a `tcp_nup` test in flent with `length` set to 200 seconds & `step-size` set to 0.05 seconds. But the test took more than 10 minutes to complete. On checking the log, I found out that the `ss_iterate.sh` was running  even after other runners had finished execution.  

https://github.com/tohojo/flent/blob/9378031415f9d87b2ef500d082f4720abcec52da/flent/scripts/ss_iterate.sh#L43-L45

My guess is that execution time of ss command was about 0.1 ish  second on average (could see from the output timestamps). So each iteration took about 0.15 seconds to execute and hence total execution of the 4200 iterations took about 10 mins.

I resolved this issue by checking current time against endtime.
```bash
command_string=$(cat <<EOF
duration="$(echo "$count*$interval" | bc) sec";
endtime=\$(date -d "\$duration" +%s%N);
while (( \$(date +%s%N) <= \$endtime )); do
    ss -t -i -p -n state connected "dst $target $filter"
```

Infact the issue exists with `tc_iterate.sh` as well. But the execution time only exceeded by about 20 seconds.

Now this might be a bad idea in general since the use of `bc` and the additional `date` commands may add some overhead (although I didn't see any notable difference b/w timestamps).  

Does this fix seem like a good PR (to `tc_iterate.sh` and `ss_iterate.sh`)? (The endtime calculation can be done from python code and passed to this script instead of passing ```count (test_length / interval)```)
 > (I am using flent with network namespaces in Ubuntu 20.04 machine. I am unsure if this works with other environments)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tohojo/flent/issues/236

[-- Attachment #2: Type: text/html, Size: 3636 bytes --]

             reply	other threads:[~2021-09-08 16:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 16:18 Shashank D [this message]
2021-09-13 11:48 ` [Flent-users] " Toke Høiland-Jørgensen
2021-09-14  7:38 ` Shashank D
2021-09-14 10:46 ` Toke Høiland-Jørgensen
2021-09-14 16:14 ` Shashank D
2021-09-14 20:46 ` Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.flent.org/postorius/lists/flent-users.flent.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tohojo/flent/issues/236@github.com \
    --to=notifications@github.com \
    --cc=flent@noreply.github.com \
    --cc=reply+AHVNJP47VZ3FEMXIQAIXV6F7ITBUHEVBNHHDWFR3SE@reply.github.com \
    --cc=subscribed@noreply.github.com \
    --subject='Re: [Flent-users] [tohojo/flent] ss_iterate.sh unnecessarily runs  for a long time (#236)' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox