talent-plan
talent-plan copied to clipboard
rust: project 4 benchmarking problems
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.
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/
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.
Make the port part of the argument 0. E.g “127.0.0.1:0”?