uWSGI and joblib Semaphore: Joblib will operate in serial mode

前端 未结 3 848
逝去的感伤
逝去的感伤 2021-02-10 14:48

I\'m running joblib in a Flask application living inside a Docker container together with uWSGI (started with threads enabled) which is started by supervisord.

The start

3条回答
  •  囚心锁ツ
    2021-02-10 15:11

    It seems that semaphoring is not enabled on your image: Joblib checks for multiprocessing.Semaphore() and it only root have read/write permission on shared memory in /dev/shm. Have a look to this question and this answer.

    This is run in one of my containers.

    $ ls -ld /dev/shm
    drwxrwxrwt 2 root root 40 Feb 19 15:23 /dev/shm
    

    If you are running as non-root, you should change the permission on /dev/shm. To set the correct permissions, you need to modify the /etc/fstab in you Docker image:

    none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
    

提交回复
热议问题