I have a bash script to start the Dask scheduler and workers. It determines the number of physical CPUs (NCPU) and the amount of available memory (MEM)
NCPU
MEM