There are many good articles online about how to properly configure/tune your PHP/
Apache Settings.
Apache MPM event is configured through /etc/apache2/mods-enabled/mpm_event.conf on Ubuntu, CentOS would be different but similar.
The default settings for you would probably be ok, but maybe raise "MaxRequestWorkers" from the default 150 to 400 or something. I think over 400 requires a higher serverlimit configuration but I'm not sure as we run load balanced servers and don't need a higher value.
PHP FPM settings would be in /etc/php//fpm/pool.d/www.conf on Ubuntu, as before it would similar on CentOS.
The default www.conf settings only give you about 5 php processes I think, not enough to run 300 students on a quiz. There is no exact rule here to set the pm.* values but it does depend on the basic formula of "RAM free / PHP process size".
An average PHP process size (depending on what you're doing) could be 300M (round up to give some padding). Say 64 GB is only running the web server, take off 2GB for the OS, maybe 1GB for Opcache, xGB for something else and you have 60GB left.
pm.max_children would then be 60GB * 1024MB = 61440MB / 300MB = ~200 processes
pm.start_servers then runs on a different formula of "min_spare_servers + (max_spare_servers - min_spare_servers) / 2"
Those might look like: (min/max just made up values, but you may want more/less spare than that)
pm.start_servers = 40
pm.min_spare_servers = 30
pm.max_spare_servers = 50
If you also run the DB on this server too and any other caching, you also need to remove all that RAM from the available pool before you calculate how much PHP can use.
Also, leaving the php memory limit to -1 may cause issues with scripts taking all the ram. Best to leave it as a hard value and only raise it if needed. Moodle will also automatically raise it for areas such as backups if required.