The php.ini file really has no direct impact on performance.
These settings really are only saying that a PHP script can run for 20 minutes before it gets killed, the script can use up to 4GB of memory (way too high), a file up to 600MB can be uploaded and the posted data to the server can be 2GB and up to 20 files.
The only thing to configure in the php.ini file for performance is the opcache settings, but they should probably be in a conf.d directory but that's just semantics.
Also, DB connection limits don't impact your performance. For roughly 1000 quiz users, you might only have 200 active database connections. Without setting an upper limit on your database connections, MySQL sets per connection memory buffers so you can easily over commit your RAM and crash or cause worse performance to your server.
Your 5 Application servers with 8GB ram will need to be properly configured with PHP opcache, PHP-FPM and Apache or NGINX (or other web server). This will make sure you can have the max number of PHP processes running to handle incoming requests. The default is 5 for PHP-FPM but a good number may be 20 (for example). Google how to set this number properly based on PHP process size.
I don't know how much you can configure AWS RDS databases, but you need to make sure that you have your DB in memory which is normally controlled by InnoDB buffer settings. There are lots of good guides on how to set these properly.
A 2 core, 8GB server may not be powerful enough but I don't have any information on your DB size.
If you can provide more information on your configs or requirements, we may be able to provide some further assistance.
When you start to get to 1000 or more quiz users, there are other aspects too, what plugins are installed, when do their scheduled tasks run, are there other underlying performance issues etc. This can only be shown with proper monitoring.
Set up really (really) good monitoring before you run your tests and exams to show you exactly where the bottleneck is. It could be shared disk, DB server, caching, app servers, etc.