Best configurations for speeding up standalone discourse

What’s the source of 502s? not enough unicorn workers? We just moved servers and users have been reporting occasional 502s after the move. We have a 6C/16GB server, and set the unicorn_workers to 16 (before we moved server it was at 12), db_shared_buffer to 4GB, db_work_mem to 60MB.

Would having too many unicorn workers cause 502s? (speculating since we had 4 fewer before the server migration)

I am trying to see if its the configuration that we need to tweak or something else that we need to address.

Thanks.