title: Sharing static global data among processes in a Gunicorn / Flask app
body: <p>I have a Flask app running under Gunicorn, using the sync worker type with 20 worker processes.  The app reads a lot of data on startup, which takes time and uses memory.  Worse, each process loads its own copy, which causes it to take even longer and take 20X the memory.  The data is static and doesn't change.  I'd like to load it once and have all 20 workers share it.</p>
  
  <p>If I use the <code>preload_app</code> setting, it only loads in one thread, and initially only takes 1X memory, but then seems to baloon to 20X once requests start coming in.  I need fast random access to the data, so I'd rather not do <a href="https://stackoverflow.com/questions/16366124/share-a-numpy-array-in-gunicorn-processes">IPC</a>.</p>
  
  <p>Is there any way to share static data among Gunicorn processes?</p>