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

RemoteRunAwsService adds unnecessary delay to Island startup #1636

Closed
1 task
mssalvatore opened this issue Dec 1, 2021 · 2 comments · Fixed by #1919
Closed
1 task

RemoteRunAwsService adds unnecessary delay to Island startup #1636

mssalvatore opened this issue Dec 1, 2021 · 2 comments · Fixed by #1919
Labels
Beginner friendly New to the project? This issue is good for you! Code Quality Deficiencies in code quality Complexity: Low Help wanted Impact: Medium Performance Refactor

Comments

@mssalvatore
Copy link
Collaborator

mssalvatore commented Dec 1, 2021

When Monkey Island starts, it checks to see if it's running on an AWS instance. When it performs this check, it makes 2 calls, each with a 2-second timeout. In the case where the Island is not running on an AWS instance, this adds approximately 2-4 seconds to the startup of the Island. For users, this is a mild inconvenience. For developers, it's a full-blown annoyance.

Find a way to eliminate this delay. Possible solutions might be:

  1. Lazy-load the AwsInstance object in RemoteRunAwsService, so that it's not actually created until it's need.
  2. Initialize the RemoteRunAwsService on a separate thread so that it does not delay the rest of the startup process.

Note: This doesn't seem to be an issue while running from source on Windows (with pycharm) but does manifest when run from the MSI. It also manifests while running from source on Linux.

Tasks

@mssalvatore mssalvatore added Help wanted Beginner friendly New to the project? This issue is good for you! Impact: Medium Complexity: Low Code Quality Deficiencies in code quality Refactor Performance labels Dec 1, 2021
@acepace
Copy link
Contributor

acepace commented Jan 31, 2022

Why even have the 2 second timeout? If it's calling the AWS metadata instance, that should be a sub 250ms call.

@mssalvatore
Copy link
Collaborator Author

Why even have the 2 second timeout? If it's calling the AWS metadata instance, that should be a sub 250ms call.

Is there any documentation from AWS regarding this? I'm not sure what an appropriate timeout would be, what guarantees AWS makes about its network latency, and what other variables are in the mix. My guess is it's set that high to prevent a false negative as a result of a temporary network disruption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Beginner friendly New to the project? This issue is good for you! Code Quality Deficiencies in code quality Complexity: Low Help wanted Impact: Medium Performance Refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants