Opensearch cold start

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

Opensearch 2.14.0

Describe the issue:

I have a working OpenSearch instance in a Docker container, and my issue is related to cold starts. I’m getting a timeout if I don’t make any queries for even just a few minutes (like 10 or 15 minutes). After I try again, it works, but this is not the behavior I would like.

Is any configuration I can tune to avoid this problem? This is the docker compose I used to install opensearch:

version: '3.8'
services:
  opensearch:
    image: opensearchproject/opensearch:latest
    container_name: opensearch
    environment:
      - discovery.type=single-node
      - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx3g"
      - "OPENSEARCH_SECURITY_ENABLED=true"
      - "OPENSEARCH_SECURITY_AUTHENTICATION_AUTHC_BASIC_INTERNAL_USERS=admin:pass"
      - "OPENSEARCH_INITIAL_ADMIN_PASSWORD=pass"
    ports:
      - "9200:9200"
    volumes:
      - /home/azureuser/opensearch/volume:/usr/share/opensearch/data
    deploy:
      resources:
        limits:
          memory: 4g

Configuration:

---

cluster.name: docker-cluster

# Bind to all interfaces because we don't know what IP address Docker will assign to us.

network.host: 0.0.0.0

# # minimum_master_nodes need to be explicitly set when bound on a public IP

# # set to 1 to allow single node clusters

# discovery.zen.minimum_master_nodes: 1

# Setting network.host to a non-loopback address enables the annoying bootstrap checks. "Single-node" mode disables them again.

# discovery.type: single-node

######## Start OpenSearch Security Demo Configuration ########

# WARNING: revise all the lines below before you go into production

plugins.security.ssl.transport.pemcert_filepath: esnode.pem

plugins.security.ssl.transport.pemkey_filepath: esnode-key.pem

plugins.security.ssl.transport.pemtrustedcas_filepath: root-ca.pem

plugins.security.ssl.transport.enforce_hostname_verification: false

plugins.security.ssl.http.enabled: true

plugins.security.ssl.http.pemcert_filepath: esnode.pem

plugins.security.ssl.http.pemkey_filepath: esnode-key.pem

plugins.security.ssl.http.pemtrustedcas_filepath: root-ca.pem

plugins.security.allow_unsafe_democertificates: true

plugins.security.allow_default_init_securityindex: true

plugins.security.authcz.admin_dn: ['CN=kirk,OU=client,O=client,L=test,C=de']

plugins.security.audit.type: internal_opensearch

plugins.security.enable_snapshot_restore_privilege: true

plugins.security.check_snapshot_restore_write_privileges: true

plugins.security.restapi.roles_enabled: [all_access, security_rest_api_access]

plugins.security.system_indices.enabled: true

plugins.security.system_indices.indices: [.plugins-ml-agent, .plugins-ml-config, .plugins-ml-connector,

.plugins-ml-controller, .plugins-ml-model-group, .plugins-ml-model, .plugins-ml-task,

.plugins-ml-conversation-meta, .plugins-ml-conversation-interactions, .plugins-ml-memory-meta,

.plugins-ml-memory-message, .plugins-ml-stop-words, .opendistro-alerting-config,

.opendistro-alerting-alert*, .opendistro-anomaly-results*, .opendistro-anomaly-detector*,

.opendistro-anomaly-checkpoints, .opendistro-anomaly-detection-state, .opendistro-reports-*,

.opensearch-notifications-*, .opensearch-notebooks, .opensearch-observability, .ql-datasources,

.opendistro-asynchronous-search-response*, .replication-metadata-store, .opensearch-knn-models,

.geospatial-ip2geo-data*, .plugins-flow-framework-config, .plugins-flow-framework-templates,

.plugins-flow-framework-state]

node.max_local_storage_nodes: 3

######## End OpenSearch Security Demo Configuration ########

Relevant Logs or Screenshots: