uWSGI master thread does not share data with worker process and its threads

Viewed 14

I am running my (python) app with uwsgi with just 1 worker process & multiple threads

cheaper-initial = 1
processes = 2
threads = 10
cheaper = 1
master = true
enable-threads = true

and my app loads from data in memory and requests serve that data (no request ever modifies it). The data is loaded 5 mins after application startup adn the master process loads it. But the worker process( & threads?) are created before this so when a thread/worker gets a request, it cannot find the data loaded and throws a 503.

(Yes, I know a db is the way to go but for now, we're workign with in memory)

Is there anyway I can share this data correctly/consistently (it's also refreshed once every day by a BackgroundScheduler) with all worker/threads?

0 Answers
Related