There was a discussion more than 5 years ago mentioning that 16GB of RAM should be fine for 2,000 students. Is that still the case?
https://webwork.maa.org/moodle/mod/forum/discuss.php?d=6388
We have almost daily crashes with 24 GB of RAM and about 3,000 students on WeBWorK version 2.17. (Many high schools are using our WeBWorK server.)
Last semester with version 2.16, we had maybe 500 fewer students, with crashes only for things that I was able to identify and correct as mistakes.
Right now, what I see is that 101 apache processes wanted to take up 24.5 GB of RAM. Nine of those apache processes use between 400 and 570 MB each.
Unfortunately, oom-killer always chooses mysqld to kill, probably because that uses the largest amount of memory, which is 2.3GB.