WeBWorK Main Forum

Estimating server load for online exams

Re: Estimating server load for online exams

by Danny Glin -
Number of replies: 0
Be careful about taking advice from old posts. The post suggesting using max_connections=5000 is from 2011, and much has changed since then.

The database interaction from an apache process is completely independent of which course it is accessing, so the only time an apache process will open an additional connection to the database is if it can't use the existing one because of some error. We have two web servers each with MaxRequestWorkers set to 50. I had max_connections on the DB server set to 500 because it was also hosting a Moodle database, and we never saw the "too many connections" error.

In fact, a current check shows the following:
MariaDB [(none)]> show global status like 'Max_used_connections';
| Variable_name | Value |
| Max_used_connections | 101 |

This means that there has never been more than 101 simultaneous connections since the DB was last restarted (which in this case was a couple of weeks ago, but there have been a number of gateway quizzes run since then). From this I'm concluding that each apache process only opens one connection.

You are correct, max_connections < MaxRequestWorkers is very bad, but you should only need to increase max_connections to a number larger than MaxRequestWorkers by some buffer amount. I would think that 200 would be more than enough.