On 3/9/07, Sebastian Heinlein <[EMAIL PROTECTED]> wrote: > we already use 10 concurrent ping worker threads. I haven't yet made any > test about how many pings we could start at the same time. Each ping has > got a time out of 2 seconds.
I set it to 250, and the ping test came back quickly. > I had the same idea in my mind when I started on this. At first I wanted > to start 10 connections and kill the other s when the first round-trip > was complete. But a main showstopper was a missing native implementation > of ICMP in python. Hrmm, I have not used ICMP in Python. But why not just TCP ping the mirror on the selected port? Perform a parallel race condition on all mirrors and take the top 10 servers that you get a SYN/ACK from first. Then, perform download tests on those 10 servers as you currently do. > If you are familiar with network programming in python I would > appreciate patches and suggestion s on how to improve the current not > optimised solution. The problem appears to be in the thread.join() call, which slows down the entire selection algorithm to be the slowest of all threads, right? So, if you can remove the external ICMP echo request, and replace it with a simple TCP ping on the mirror's port in native Python, and have the ability to cancel the threads which are slow (or remove the join()), then I think that is the best solution. I haven't really tried hacking it. I figure you got a better idea now with my new suggestions. Let me know if you don't think they make sense. But I think you could get this algorithm down to <5 seconds, given the user has a decent pipe (non-dialup)... -- Kristian Hermansen -- Select Best Server can be more efficient by pinging in parallel https://launchpad.net/bugs/90379 -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs