diff --git a/readthedocs/doc_builder/constants.py b/readthedocs/doc_builder/constants.py index f5b305c2c55..8bb42b0a3cd 100644 --- a/readthedocs/doc_builder/constants.py +++ b/readthedocs/doc_builder/constants.py @@ -50,6 +50,12 @@ 'memory': '7g', 'time': 1800, }) +elif total_memory > 7000: + # This is to catch AWS instances that actually only have 7.5G memory + DOCKER_LIMITS.update({ + 'memory': '6g', + 'time': 1800, + }) elif total_memory > 4000: DOCKER_LIMITS.update({ 'memory': '3g', diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 65af1bc7688..867b4712777 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -23,6 +23,7 @@ from readthedocs.builds.constants import LATEST, STABLE, INTERNAL, EXTERNAL from readthedocs.core.resolver import resolve, resolve_domain from readthedocs.core.utils import broadcast, slugify +from readthedocs.doc_builder.constants import DOCKER_LIMITS from readthedocs.projects import constants from readthedocs.projects.exceptions import ProjectConfigurationError from readthedocs.projects.managers import HTMLFileManager @@ -896,7 +897,7 @@ def repo_nonblockinglock(self, version, max_lock_age=None): if max_lock_age is None: max_lock_age = ( self.container_time_limit or - settings.DOCKER_LIMITS.get('time') or + DOCKER_LIMITS.get('time') or settings.REPO_LOCK_SECONDS )