this is what discourse-setup does:
# db_shared_buffers: 128MB for 1GB, 256MB for 2GB, or 256MB * GB, max 4096MB
# UNICORN_WORKERS: 2 * GB for 2GB or less, or 2 * CPU, max 8
‘max’ can be taken with a pinch of salt there, particularly big communities will see benefits beyond those numbers.
So yes, in your case it should have specified the maximums of 8 workers and 4096MB. If you reduce the workers and shared buffers available to Discourse then it will tap out before all of the resources on the VM are consumed.
This post from @mpalmer is still good guidance: