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

[ENHANCEMENT] Make mem and cpu dynamic #156

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

[ENHANCEMENT] Make mem and cpu dynamic #156

wants to merge 4 commits into from

Conversation

DonRichards
Copy link
Member

@DonRichards DonRichards commented Jan 29, 2020

GitHub Issue: Islandora/documentation#1413

What does this Pull Request do?

  1. Assess how much ram is available.
  2. If "ISLANDORA_VAGRANT_MEMORY" is set use it. Otherwise If "ISLANDORA_VAGRANT_MEMORY" is blank use whichever is larger, 1/2 the RAM or 4GB.
  3. If "ISLANDORA_VAGRANT_CPUS" is set use it. Otherwise if "ISLANDORA_VAGRANT_CPUS" is blank and there are no other VMS running set the CPU to 1/2 of the available CPUs, otherwise default to 1 core.

What's new?

It looks up if VMS are running so that it doesn't over allocate the VM resources.

How should this be tested?

  • Test on a MAC, Linux, and windows machine to verify the test commands don't fail on a specific OS.
  • Test if the 2 variable overrides work "ISLANDORA_VAGRANT_MEMORY" & "ISLANDORA_VAGRANT_CPUS"
  • Test that the defaults are triggered when different VM is already running. This avoids issues will allocating too much RAM/CPUs collectively. It was brought up on the CLAW call as a check that would be useful.
# How many Cores
$ lscpu

# How much memory
$ free -h | gawk  '/Mem:/{print $2}'

Additional Notes:

N/A

Interested parties

@Islandora-Devops/committers

@DonRichards
Copy link
Member Author

The CPU detect is off. Working on it.

 IOAPIC needs to be enabled to pick up the other cores. With an I/O APIC, operating systems can use more than 16 interrupt requests (IRQs) and therefore avoid IRQ sharing for improved reliability.
@DonRichards
Copy link
Member Author

Ready for testing. @dannylamb @Islandora-Devops/committers

@DonRichards
Copy link
Member Author

Screen Shot 2020-01-30 at 10 38 05 AM

From the host machine I ran this. Not sure what to suggest for linux or windows to make the comparison but it should be easy enough.

$ sysctl hw.ncpu
hw.ncpu: 8

$ system_profiler SPHardwareDataType | grep "  Memory:"
Memory: 64 GB

@DonRichards DonRichards changed the title Make mem and cpu dynamic [ENHANCEMENT] Make mem and cpu dynamic Apr 15, 2020
@DonRichards
Copy link
Member Author

@Islandora-Devops/committers Is there any interest in having this merged?

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

Successfully merging this pull request may close these issues.

1 participant