Bei der Erzeugung einer Instanz der Klasse pymongo.MongoClient habe ich in unregelmäßigen Abständen folgenden Fehler:
Code: Alles auswählen
...
File "/srv/foo/src/bar.mongodb.core/bar/mongodb/core/clients.py", line 78, in get_client
db_clients_uri[key] = pymongo.MongoClient(host)
File "/home/foo/src/pymongo-3.12.1-py3.6-linux-x86_64.egg/pymongo/mongo_client.py", line 779, in __init__
self._get_topology()
File "/home/foo/src/pymongo-3.12.1-py3.6-linux-x86_64.egg/pymongo/mongo_client.py", line 1297, in _get_topology
self._kill_cursors_executor.open()
File "/home/foo/src/pymongo-3.12.1-py3.6-linux-x86_64.egg/pymongo/periodic_executor.py", line 87, in open
thread.start()
File "/home/foo/src/Python-3.6/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
Code: Alles auswählen
from logging import getLogger
logger = getLogger('threading')
try:
import subprocess
total, used, free = map(
int, subprocess.check_output(['free', '-t']).splitlines()[-1].split()[1:])
logger.error('### RAM memory used: {} %'.format(str(round((used/total) * 100, 2))))
import threading
logger.error('### PYTHON threads: '+str(threading.active_count()))
except Exception as err:
logger.error('### RAM memory error '+str(err))
RAM memory error [Errno 11] Diese Ressource ist zur Zeit nicht verfügbar
Kann die Log-Ausgabe eindeutig interpretiert werden?
a) Können beim Aufruf von subprecess.check_output() aufgrund des Thread-Problems einfach keine neuen Threads mehr erzeugt werden oder
b) ist das RAM-Limit erreicht oder
c) ?
Besten Dank!