Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parrallel pings #241

Closed
3 tasks done
christopherreay opened this issue Sep 12, 2019 · 12 comments
Closed
3 tasks done

parrallel pings #241

christopherreay opened this issue Sep 12, 2019 · 12 comments

Comments

@christopherreay
Copy link
Contributor

christopherreay commented Sep 12, 2019

Parrallel pings

When I am travelling I often find that I am connecting repeatedly to different wifi's or more likely after putting my laptop into suspend.

Because of this I find waiting for the pings to 10 servers takes slightly longer than feels right to my flow.

I would like to implement sending the pings to the servers in parrallel with each other.

implementation design decisions

  • change: def ping_servers(better_servers_list: List, pings: str, stats: bool) -> List:
    • - Implement sending pings to servers in parrallel
    • - default to send pings in parallel add option to send in series
      • series pings removed completely

questions / discussion

  • are there any reasons not to send the pings in parrallell?
    • perhaps may use more ram than is suitable for openpyn running on router hardware
  • is there any case where a "fallback" to sending pings in series is required?

state of implementation

  • - ~~ implement parallel pings with tests ~~
@jotyGill
Copy link
Owner

Cheers mate. Sounds good to me :)
The only potential problem we could have is resourse usage on WRT routers. I don't know how much ram it would use to implement threading?
That's the only case we might need to fall back.

@christopherreay
Copy link
Contributor Author

OK, so for now default to serial, and make an option for parrallel?

@jotyGill
Copy link
Owner

I guess we go default with parallel. If it's a problem then we'll see.

@jotyGill
Copy link
Owner

Also could please make sure to pull all my commits in the 'test' branch first. Cheers

@christopherreay
Copy link
Contributor Author

so use the test branch as the base?

@christopherreay
Copy link
Contributor Author

yessir !

@jotyGill
Copy link
Owner

Yes plz.

@christopherreay
Copy link
Contributor Author

okay coke

@christopherreay
Copy link
Contributor Author

I wonder if the multithreading can be done only in the OS, rather than in python. Will check it out

@jotyGill
Copy link
Owner

we just need to run some subprocess commands in parallel and capture their output later.
something like this?
https://stackoverflow.com/questions/23818569/run-subprocesses-in-parallel

@christopherreay
Copy link
Contributor Author

Hello :)

Ive got the parallel pings running. I have to tidy up and finish it off for the pull request.

The other thing that takes time is the -f option dhcp things. Is there a way of doing that faster? What is it called? Lets open an issue about it?

@christopherreay
Copy link
Contributor Author

christopherreay commented Sep 15, 2019

I had to put a 0.01 second delay between the subprocess.Popen calls to ping, because otherwise packets were dropped for "no reason". It is satisfyingly quicker.

The sequential option is implemented as "-S --sequential"

christopherreay added a commit to christopherreay/openpyn-nordvpn that referenced this issue Sep 15, 2019
christopherreay added a commit to christopherreay/openpyn-nordvpn that referenced this issue Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants