talent-plan icon indicating copy to clipboard operation
talent-plan copied to clipboard

rust: project 4 benchmarking problems

Open brson opened this issue 5 years ago • 3 comments

On slack QuRyu reported some problems completing the project 4 benchmarks: https://tikv-wg.slack.com/archives/CKD9363A8/p1568990445005500

The two main problems:

  • They ran into ulimits for open socks. I believe this benchmark describes opening many sockets at once. For simplicity it might be best to pick a number that is lower than the default ulimits. This could be an opportunity to discuss ulimits, which are something that plague networked programs and their test suits, but also this section is already super complicated - adding a ulimit digression would just make it more so.
  • They needed to search for an unbound port for the server. This seems to indicate that criterion is running benchmarks in parallel, which is surprising.

brson avatar Sep 22 '19 03:09 brson

I have run the benchmark in the example code and the program also threw the error Address already in use. But it works fine if available ports are searched. Is criterion in rust just a thin wrapper around the one in Haskell or is it complete rewritten in rust? I saw there is a thread on reddit discussing similar issues: https://www.reddit.com/r/haskell/comments/2m0pv6/force_criterion_to_benchmark_sequentially_for/

QuRyu avatar Sep 22 '19 16:09 QuRyu

If sample size exceed 10, TcpStream::connect(addr) returns an AddrInUse(10048) error frequently on windows. The client socket port is allocated by OS, I don't konw how to set an idle port on client side.

howz97 avatar May 12 '22 04:05 howz97

Make the port part of the argument 0. E.g “127.0.0.1:0”?

reedobrien avatar May 12 '22 13:05 reedobrien