I'm using the standard egress template, maybe it's a bug in the template?
I think the issue is not only in the definition of what to show (or very unoptimized written) because if 10 tracks, the load is about 50%. (CPU load grows too fast between 10 and 25).
In any case I will be grateful if you can tell me if there is a ready-made solution that is more optimal for many streams (200-300 participants with cameras on) or where to dig to solve the problem?