Worker_rlimit_nofile os vs. master vs. workers

Doing some tuning, and want to make sure I understand what the effects
are of various parameters. As I understand, this is how many open files
the os (linux) as a whole is currently set to handle.

cat /proc/sys/fs/file-max
169203

Then, there is a limit I am setting in the init script for nginx. Let’s
say this number is 20480.

ulimit -n 20480

Then, in the nginx config, we can set the number of workers and open
files for each worker process. For example:

worker_processes 2;
worker_rlimit_nofile 10240;


worker_connections 10240;

My question is, does the 20480 limit set in the init script affect:

  1. the TOTAL number of files that can be open by ALL workers
  2. the number of files that can be open by EACH worker
  3. something else I don’t understand.

Thanks,
Brad