Search code examples
dockerdockerfilegunicornpython-polars

polars causing gunicorn worker to be terminated due to signal 4


Currently I am deploying a dash application using gunicorn and docker on my company server machine. This is the current output [2023-04-27 10:42:26 +0000] [1] [WARNING] Worker with pid 223 was terminated due to signal 4 [2023-04-27 10:42:26 +0000] [233] [INFO] Booting worker with pid: 233 [2023-04-27 10:42:27 +0000] [1] [WARNING] Worker with pid 225 was terminated due to signal 4 [2023-04-27 10:42:27 +0000] [235] [INFO] Booting worker with pid: 235 [2023-04-27 10:42:27 +0000] [1] [WARNING] Worker with pid 226 was terminated due to signal 4 [2023-04-27 10:42:27 +0000] [236] [INFO] Booting worker with pid: 236 [2023-04-27 10:42:28 +0000] [1] [WARNING] Worker with pid 230 was terminated due to signal 4 [2023-04-27 10:42:28 +0000] [240] [INFO] Booting worker with pid: 240 [2023-04-27 10:42:28 +0000] [1] [WARNING] Worker with pid 232 was terminated due to signal 4 [2023-04-27 10:42:28 +0000] [242] [INFO] Booting worker with pid: 242 [2023-04-27 10:42:29 +0000] [1] [WARNING] Worker with pid 233 was terminated due to signal 4 [2023-04-27 10:42:29 +0000] [243] [INFO] Booting worker with pid: 243 [2023-04-27 10:42:29 +0000] [1] [WARNING] Worker with pid 235 was terminated due to signal 4 [2023-04-27 10:42:29 +0000] [245] [INFO] Booting worker with pid: 245

I tested the docker image on my host machine, it works, but unable to deploy it on my company servers machine.

A little more context on the application. The library uses polars library, which I believe is causing the issue as I did not face this issue when i replace polars with pandas. However, I would like to use polars it is much faster.

Any help will be appreciated.


Solution

  • Could you try polars-lts-cpu. Signal 4 seems to be caused by an illegal instruction. That likely means that the default binary is compiled for a target CPU not available on your server.

    polars-lts-cpu are the binaries that are compiled with more conservative target features.