Skip to content

Commit

Permalink
Stick to 1g default but use as Xmx value
Browse files Browse the repository at this point in the history
  • Loading branch information
roborourke committed Sep 21, 2021
1 parent 0a848e2 commit eaf1a18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion inc/composer/class-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected function get_env() : array {
'DOCKER_CLIENT_TIMEOUT' => 120,
'COMPOSE_HTTP_TIMEOUT' => 120,
'PATH' => getenv( 'PATH' ),
'ES_MEM_LIMIT' => getenv( 'ES_MEM_LIMIT' ) ?: '2g',
'ES_MEM_LIMIT' => getenv( 'ES_MEM_LIMIT' ) ?: '1g',
'HOME' => getenv( 'HOME' ),
];
}
Expand Down
6 changes: 3 additions & 3 deletions inc/composer/class-docker-compose-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ protected function get_service_db() : array {
* @return array
*/
protected function get_service_elasticsearch() : array {
$mem_limit = getenv( 'ES_MEM_LIMIT' ) ?: '2g';
$mem_limit = getenv( 'ES_MEM_LIMIT' ) ?: '1g';

$version_map = [
'7.10' => 'humanmade/altis-local-server-elasticsearch:4.1.0',
Expand Down Expand Up @@ -349,8 +349,8 @@ protected function get_service_elasticsearch() : array {
// Force ES into single-node mode (otherwise defaults to zen discovery as
// network.host is set in the default config).
'discovery.type=single-node',
// Reduce from default of 1GB of memory to 512MB.
'ES_JAVA_OPTS=-Xms1g -Xmx1g',
// Use max container memory limit as the max JVM heap allocation value.
"ES_JAVA_OPTS=-Xms512m -Xmx{$mem_limit}",
],
],
];
Expand Down

0 comments on commit eaf1a18

Please sign in to comment.