Skip to content

Commit

Permalink
Enable HTTP compression for Elasticsearch (but not in prod yet) (#21906)
Browse files Browse the repository at this point in the history
  • Loading branch information
diox committed Feb 27, 2024
1 parent 6951d52 commit 5bc8a79
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/olympia/conf/prod/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
ES_TIMEOUT = 60
ES_INDEXES = {k: f'{v}_{ENV}' for k, v in ES_INDEXES.items()}
ES_DEFAULT_NUM_SHARDS = 10
ES_COMPRESS = False

RECOMMENDATION_ENGINE_URL = env(
'RECOMMENDATION_ENGINE_URL',
Expand Down
1 change: 1 addition & 0 deletions src/olympia/lib/settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,7 @@ def read_only_mode(env):
ES_TIMEOUT = 30
ES_DEFAULT_NUM_REPLICAS = 2
ES_DEFAULT_NUM_SHARDS = 5
ES_COMPRESS = True

# Maximum result position. ES defaults to 10000 but we'd like more to make sure
# all our extensions can be found if searching without a query and
Expand Down
1 change: 1 addition & 0 deletions src/olympia/search/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def get_es():
"""Create an ES object and return it."""
return Elasticsearch(
settings.ES_HOST,
http_compress=settings.ES_COMPRESS,
timeout=settings.ES_TIMEOUT,
transport_class=AlreadyVerifiedTransport,
)
Expand Down

0 comments on commit 5bc8a79

Please sign in to comment.