* [Flent-users] Re: [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236)
2021-09-08 16:18 [Flent-users] [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236) Shashank D
@ 2021-09-13 11:48 ` Toke Høiland-Jørgensen
2021-09-14 7:38 ` Shashank D
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-09-13 11:48 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
Hmm, good question. So you're just running ss in a busy loop, or did you
keep the 'sleep'? If so, that seems a bit excessive to do by default.
I'd be a bit surprised if you could get this short a polling time out of
the shell script, actually; what interval were you able to achieve?
--
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#issuecomment-918112784
[-- Attachment #2: Type: text/html, Size: 1759 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Flent-users] Re: [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236)
2021-09-08 16:18 [Flent-users] [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236) Shashank D
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
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Shashank D @ 2021-09-14 7:38 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]
> Hmm, good question. So you're just running ss in a busy loop, or did you keep the 'sleep'? If so, that seems a bit excessive to do by default.
Yes I did keep the sleep in the loop. Here's the full loop:
```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"
echo ''
date '+Time: %s.%N';
echo "---";
sleep $interval || exit 1;
done
EOF
)
```
> I'd be a bit surprised if you could get this short a polling time out of the shell script, actually; what interval were you able to achieve?
Each iteration of this loop takes almost the same time as with the current implementation in flent. So this doesn't really help to set smaller `step-size`. But the total time of all iterations will be closer to the expected test duration set by the user.
https://github.com/tohojo/flent/blob/9378031415f9d87b2ef500d082f4720abcec52da/flent/runners.py#L1978-L1979
Here, I feel that the calculated count is a bit excessive and keeps the loop running for much longer than the set test duration. Using end time calculations in the loop will solve this issue
--
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#issuecomment-918892985
[-- Attachment #2: Type: text/html, Size: 3671 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Flent-users] Re: [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236)
2021-09-08 16:18 [Flent-users] [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236) Shashank D
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
4 siblings, 0 replies; 6+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-09-14 10:46 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]
Shashank D ***@***.***> writes:
>> Hmm, good question. So you're just running ss in a busy loop, or did you keep the 'sleep'? If so, that seems a bit excessive to do by default.
> Yes I did keep the sleep in the loop. Here's the full loop:
> ```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"
> echo ''
> date '+Time: %s.%N';
> echo "---";
> sleep $interval || exit 1;
> done
> EOF
> )
> ```
Right, makes sense. Feel free to open a PR with this, but please lose
the dependency on 'bc'. Either do the math in native shell, or just pass
the duration as a parameter from Flent.
Did you test whether this works on OpenWrt and on Dash?
--
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#issuecomment-919035245
[-- Attachment #2: Type: text/html, Size: 2521 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Flent-users] Re: [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236)
2021-09-08 16:18 [Flent-users] [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236) Shashank D
` (2 preceding siblings ...)
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
4 siblings, 0 replies; 6+ messages in thread
From: Shashank D @ 2021-09-14 16:14 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 294 bytes --]
> Did you test whether this works on OpenWrt and on Dash?
No. I could only test this on a Ubuntu machine.
--
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#issuecomment-919302179
[-- Attachment #2: Type: text/html, Size: 1579 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Flent-users] Re: [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236)
2021-09-08 16:18 [Flent-users] [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236) Shashank D
` (3 preceding siblings ...)
2021-09-14 16:14 ` Shashank D
@ 2021-09-14 20:46 ` Toke Høiland-Jørgensen
4 siblings, 0 replies; 6+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-09-14 20:46 UTC (permalink / raw)
To: tohojo/flent; +Cc: Subscribed
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
Shashank D ***@***.***> writes:
>> Did you test whether this works on OpenWrt and on Dash?
> No. I could only test this on a Ubuntu machine.
Right, okay. Well, the 'dash' shell should be available to install on
ubuntu as well. Feel free to open a PR with the change, I can test it on
OpenWrt...
--
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#issuecomment-919500031
[-- Attachment #2: Type: text/html, Size: 1787 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread