nginx cpu consumption for ssl termination with rtmp stream

512 is the default number of the worker_connections value, which defines the number of connections per process (in this case, 1CPUx512Connections). My thoughts on that is you might be hitting a default limit even though you've obviously increased the default worker_connections as defined in the docs around it. http://nginx.org/en/docs/ngx_core_module.html#worker_connections

Have you tried increasing a worker_rlimit_nofile value or checking that the /etc/security/limits.conf file has any limits in it?