uWSGI Worker Crashes on Frequent OpenSearch Requests via opensearch_dsl

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
opensearch-dsl 2.1.0
opensearch-py 2.3.0

Describe the issue:
I am running a Python Flask server in a uWSGI workers.
The uWSGI crushes when the server makes a lot of requests to OpenSearch (50 requests in 40 seconds.) It is worth noting that when I send a lot more requests to the server (200 in 40 seconds), but without the server calling the OpenSearch, the uWSGI does not crushes, indicating a problem in calling OpenSearch. also, the open search does not show logs of errors.

This is the code:

from opensearch_dsl import Search, Q
…
    @cached_property
    def opensearch_client(self):
        secret = self.vault_client.read_secret(OPENSEARCH_AUTH_VAULT_LOCATION)
        return OpenSearch(hosts=config.get('OPENSEARCH_URLS_LIST'),
                             http_auth=(secret.get('opensearch_user'), secret.get('opensearch_password')))

     def get_recording_metadata_by_file_uuid(self, file_uuid):
        s = Search(using=self.opensearch_client, index=self.custom_index).query(Q('term', id__keyword=file_uuid))
        response = s.execute()
        if response.hits:
            return response.hits[0].to_dict()
        else:
            return None

Configuration:
Debian GNU/Linux 9

Relevant Logs or Screenshots:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.