N
N
NickNameNew2021-09-10 22:44:27
Django
NickNameNew, 2021-09-10 22:44:27

Why does Django ORM not have time to update the connector in multithreading on HDD?

I ran into a problem that on HDD Django ORM does not have time to update the connector in a parallel project in which I connected the connection to the database through Django ORM

import django
SITE_PATH = os.path.abspath(os.path.dirname(__file__))
PROJECT_PATH = os.path.normpath(os.path.join(SITE_PATH, '..'))
SRC_PATH = os.path.join(PROJECT_PATH, 'api')
if SRC_PATH not in sys.path:
    sys.path.insert(0, SRC_PATH)

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings")
django.setup()

connected the models of the required table via from import and passed the table to several rabbitMQ queues.
When I run it on hardware with an SSD, it runs normally in 5 threads, but on hardware with an HDD, it normally works only in 1 thread, and if there are already 2 or more, it starts to fall off. There is a feeling that the connector does not have time to update and I get data retrieval errors (

Why can this be? Can someone explain?

I want to try using SQLAlchemy to connect to this database and access it in parallel with the Django project

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question