this is how to set maximum number of open file and maximum number of processess on systemd startup script. for example you want give nginx process nofile 20000 and nproc unlimited.
edit nginx.service file
add these into [Service] section
reload the systemd script daemon
finally, restart nginx service, and you’re done.
#systemctl restart nginx.service