use the number of physical threads your System has, which is 12 (2x6), not 24
for slightly better performance enable "hugepages" in your system or start the miner as root (xmrig can configure RAM itself)
for even better performance you could enable "1GB-hugepages" (just google xmrig 1gb-hugepages ubuntu), but this would require a lot more RAM than you currently have (at least 40 GB)