From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-20.smtp.github.com (out-20.smtp.github.com [192.30.252.203]) by mail.toke.dk (Postfix) with ESMTPS id 871208BC15B for ; Tue, 14 Sep 2021 09:38:20 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key) header.d=github.com header.i=@github.com header.b=raNST/PN Received: from github-lowworker-52827f8.ash1-iad.github.net (github-lowworker-52827f8.ash1-iad.github.net [10.56.108.24]) by smtp.github.com (Postfix) with ESMTP id 3B21FE050B for ; Tue, 14 Sep 2021 00:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1631605099; bh=chg8TUVwOV0iWZbjqc9eHH+tItTz4Y//YKFV14J5aO0=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=raNST/PNfB3IkgMA8HMTFi/vMnRIU+WGfprSLOE1/AWkDlC1Tez9vlyPtq0KRCtRZ miBsUhlwRgpi6hX+rk7M8Oh3PFsXU2BLkzYMQA8anna/eh10D2c+Y0fqAmTlWxT17E 5GWfJismTEUNqNgfpSWJx52q2MOlxT94SQi70apw= Date: Tue, 14 Sep 2021 00:38:19 -0700 From: Shashank D To: tohojo/flent Message-ID: In-Reply-To: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_6140516b2d874_2a1ac788712da"; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: list X-GitHub-Sender: shashank68 X-GitHub-Recipient: flent-users X-GitHub-Reason: subscribed X-Auto-Response-Suppress: All X-GitHub-Recipient-Address: flent-users@flent.org Message-ID-Hash: C4R3EDXSIWC3IKI6S2BEDXSVYN42ZWTH X-Message-ID-Hash: C4R3EDXSIWC3IKI6S2BEDXSVYN42ZWTH X-MailFrom: noreply@github.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Subscribed X-Mailman-Version: 3.3.4 Reply-To: tohojo/flent Subject: [Flent-users] Re: [tohojo/flent] ss_iterate.sh unnecessarily runs for a long time (#236) List-Id: Flent discussion list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: ----==_mimepart_6140516b2d874_2a1ac788712da Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > 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 < 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 ----==_mimepart_6140516b2d874_2a1ac788712da Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

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:

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, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

----==_mimepart_6140516b2d874_2a1ac788712da--