PBrockmann / wms-pyferret

Slippy maps with WMS from pyferret
MIT License
3 stars 3 forks source link

problem when gunicorn is set with multiple workers (>1) #3

Closed PBrockmann closed 7 years ago

PBrockmann commented 7 years ago

No problem when only one worker. When number of workers is set to 4 for example, the shade command run from the workers complains about accessing to the dataset. I get with my test script:

Error 2: No such file or directory
 *** Unknown error code:         0 ***

             Data set: /opt/ferret_dsets/data/levitus_climatology.cdf

Note that when I produce the plot from a memory variable like:

pyferret.run('def axis/x=-180:180:1/units=degrees_east myxaxis')
pyferret.run('def axis/y=-90:90:1/units=degrees_north myyaxis')
pyferret.run('let a=x[gx=myxaxis]*y[gy=myyaxis]/1000+17')

there is no problem

PBrockmann commented 7 years ago

pyferret.start is done from the master of gunicorn (from init). Then all workers can inherit of the environment (datasets open, defined variables).