Menu

#287 csv outputs need to call flush

1.0
pending
None
2024-01-06
2023-12-06
No

Per discusion item here needs csv flush

Discussion

  • Robert McMahon

    Robert McMahon - 2023-12-06

    Code commit is here. (sourceforge.net)

    [rjmcmahon@fedora iperf2-code]$ src/iperf -v
    iperf version 2.1.n (5 December 2023) pthreads

     
  • Jean Tourrilhes

    Jean Tourrilhes - 2024-01-04

    If running with '-P', would it be possible to only do flush for the sum report ? I'm typically running with "--interval 0.1 --parallel 1024", and I'm worried about the potential performance implications.
    Thanks in advance !
    Jean

     
    • Robert McMahon

      Robert McMahon - 2024-01-04

      Ok, this makes sense. I'll fix it.

       
      • Jean Tourrilhes

        Jean Tourrilhes - 2024-01-06

        I tried to do it myself, but I could not make it work on the server. So, I went with a completely different approach with a command line option.
        You will need to apply the first patch in all case, because sum TransferID has been broken in commit e0b803595420fe03054ff93f38ed65c0b84e6437.
        The second patch, you may just read it for your own amusement ;-)
        Regards,
        Jean

         
    • Robert McMahon

      Robert McMahon - 2024-01-05

      Here is the new flush test. Commit is in master.

      Can you try it and make sure it works ok for you?

      ~~~
      +
      +//
      +// flush when
      +//
      +// o) there is a sum report and one or less traffic threads
      +// o) this is the sum report (all preceding interval reports need flush)
      +// o) there isn't a sum report
      +// o) report interval is one second or greater
      +//
      +static inline void check_flush (struct TransferInfo *stats) {

      • if ((!(stats->ts.intervalTime.tv_sec < 1) || !stats->sumreport) || \
      • (stats->sumreport && ((stats->type == SUM_REPORT) || (stats->sumreport->reference.count < 2)))) {
      • fflush(stdout);
      • }
        +}
        +~~~
       
      • Jean Tourrilhes

        Jean Tourrilhes - 2024-01-06

        Can you try it and make sure it works ok for you?

        Thanks, I will.
        That's quite the heuristic. I'm personally not sure about the "report interval is one second or greater", because I can not see cases where you need to flush for each individual thread, and it's quite inefficient to flush all lines...
        Thanks !
        Jean

         
        • Jean Tourrilhes

          Jean Tourrilhes - 2024-01-06

          Quick test shows it work as you intended.
          Thanks !
          Jean

           
        • Jean Tourrilhes

          Jean Tourrilhes - 2024-01-06

          I'm also wondering if it would be possible to make this a static test when creating the report, instead of a dynamic test, for performance reasons.
          Regards,
          Jean

           
          • Robert McMahon

            Robert McMahon - 2024-01-06

            I decided to change the conditions to the following. Commit is here.

            The server side doesn't know at report creation the number of threads to sum. That's why the test is dynamic. The code in active_hosts.c (sourceforge.net) assigns the sum reports to new threads from the same source.

            //
            // flush when
            //
            // o) it's a final report
            // o) this is the sum report (all preceding interval reports need flush)
            // o) the time since the last flush is equal or larger to the smallest allowed report interval
            //
            
             

Log in to post a comment.

MongoDB Logo MongoDB