Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Experiment: runner pause container #621

Closed
wants to merge 2 commits into from

Conversation

PixnBits
Copy link
Contributor

@PixnBits PixnBits commented Mar 15, 2024

Provide a general summary of your changes in the Title above.

Description

Describe your changes in detail

As tenancies get larger it is slower to start the one-app server. The grand majority of this time (upwards of >70%) is parsing the modules from the module map. This startup can usually be avoided by, instead of destroying the container on runner close, pausing the container for use later when it can be unpaused.

Note that Docker uses "cgroup freezer" functionality for pausing containers/modules. The Linux VM's memory is still taken (the container's memory is not written to disk for later retrieval like a VM's can be) and the ports are still bound. Paused containers are stopped on shutdown so the one-app containers have to be started up again after a reboot.

The one-app server goes to great lengths and pains to avoid out-of-request mutations so modules updating on disk causing side effects that require a restart to change should be minimal/none and any bugs should be fixed for production.

This project only accepts pull requests related to open issues.

If suggesting a new feature or change, please discuss it in an issue first.

Motivation

Why is this change required? What issue does it resolve?

As tenancies get larger it is slower to start the one-app server. The grand majority of this time (upwards of >70%) is parsing the modules from the module map.

Test Conditions

Describe in detail how the changes are tested.

Include details of your testing environment, and the tests you ran to.

How does your change affect the rest of the code.

Types of changes

Check boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)
  • Dependency update
  • Security update

Checklist

Check boxes that apply:

  • My code follows the code style of this project.
  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • These changes should be applied to a maintenance branch.
  • I have added the Apache 2.0 license header to any new files created.

const spawn = require('./asyncSpawn');
const spawnAndPipe = require('./spawnAndPipe');

const docker = new Docker();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this being a file global...
maybe a separate file for sharing between startAppContainer.js & startApp.js? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this creates a socket/network connection to the docker daemon)

Copy link

This pull request is stale because it has been open 30 days with no activity.

@10xLaCroixDrinker 10xLaCroixDrinker deleted the experiment/runner_pause-container branch May 15, 2024 12:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants