Skip to content

Commit 456dd93

Browse files
authored
Merge pull request #6982 from readthedocs/hotfix/more-memory-limits
More fixes for automatic Docker limits
2 parents ed6591b + 65e1d72 commit 456dd93

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

readthedocs/doc_builder/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
'memory': '7g',
5151
'time': 1800,
5252
})
53+
elif total_memory > 7000:
54+
# This is to catch AWS instances that actually only have 7.5G memory
55+
DOCKER_LIMITS.update({
56+
'memory': '6g',
57+
'time': 1800,
58+
})
5359
elif total_memory > 4000:
5460
DOCKER_LIMITS.update({
5561
'memory': '3g',

readthedocs/projects/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from readthedocs.builds.constants import LATEST, STABLE, INTERNAL, EXTERNAL
2424
from readthedocs.core.resolver import resolve, resolve_domain
2525
from readthedocs.core.utils import broadcast, slugify
26+
from readthedocs.doc_builder.constants import DOCKER_LIMITS
2627
from readthedocs.projects import constants
2728
from readthedocs.projects.exceptions import ProjectConfigurationError
2829
from readthedocs.projects.managers import HTMLFileManager
@@ -896,7 +897,7 @@ def repo_nonblockinglock(self, version, max_lock_age=None):
896897
if max_lock_age is None:
897898
max_lock_age = (
898899
self.container_time_limit or
899-
settings.DOCKER_LIMITS.get('time') or
900+
DOCKER_LIMITS.get('time') or
900901
settings.REPO_LOCK_SECONDS
901902
)
902903

0 commit comments

Comments
 (0)