Forking on 13.3 restricting to same CPU core

Hi all,

We have an in-house php script that processes images. Been running it for years. It forks itself a number of times to increase the amount of images we can process per second. 13.2 has been running great. When upgrading to 13.3 or 14.0, the php forked processes all end up leveraging the came cpu core, and that slows us waaay down.

I had a 13.2 userland, and 13.3 kernel and the issue does not occur.
Using a 13.3 userland and 13.3 kernel the issues DOES occur. Same with a fresh install of 14.0 userland/kernel.

Leveraging the pkg php82 from 13.2 land on 13.3 or the 13.3 pkg php82 does not matter, both show the same issue.

Something in the userland/libraries with 13.3 apparently is restricting forked php processes from leveraging any additional cpu cores. Any ideas where/what/how/why?

Thanks!
 
Tracked this down to ImageMagick7 compiled with OpenMP support on FreeBSD 13.3 or 14.0. Doesnt matter if I compile it against the default llvm17 in 13.3, or llvm19 (devel) pkg or llvm14 on FreeBSD 13.3. If I compile WITHOUT OpenMP in ImageMagick, the forked processes use whatever CPU ID they want. Still trying to determine why ImageMagick7 with OpenMP is not working properly on FreeBSD 13.3.
 
You may want to read the documentation for OpenMP. When using it, it changes a lot of behavior of parallel (multi-process or multi-threaded) programs. I've done some work on the IO side of OpenMP (but am not an expert on the CPU and message passing side), and it has very tight control of how tasks are scheduled on different cores. If you don't like that, it would probably be better to not compile/link against OpenMP.
 
Back
Top