Does max_connection=100 mean only 100 students simultaneously can attempt a quiz ?

Does max_connection=100 mean only 100 students simultaneously can attempt a quiz ?

by Mario Gharib -
Number of replies: 3

Dear Moodlers,

I would like to share with you a problem that we faced during an exam on Moodle

We are using the LMD

  • Moodle 3.1 (Postgresql 9.2.2; PHP Version 5.5.26) with
  • Server RedHatEnterpriseServer 5.3 Tikanga (Apache/2.2.4) RAM 8GB; CPU 3,07 GHz

We've faced a problem during the exam and in the log file we noticed that on

[Fri Jan 13 08:31:57 2017] [error] [client 172.17.34.16] PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: sorry, too many clients already in /usr/local/apache2/htdocs/moodle2.2/lib/dml/pgsql_native_moodle_database.php on line 159, referer: https://moodle.usj.edu.lb/mod/quiz/attempt.php?attempt=82596

The max_connection of PostgreSQL is set to 100,

Does it mean that I can only have a quiz of 100 students at the same time ?
If this is the case, what is the best number of max_connection with my server's specifications?

Many Thanks.

Mario.

Average of ratings: -
In reply to Mario Gharib

Re: Does max_connection=100 mean only 100 students simultaneously can attempt a quiz ?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It does not mean that, because even when a student is attempting the quiz, most of the time they are just interacting with a page in their web browser, which does not involve the Moodle server. It is only when they submit a page of the quiz (or when autosave happens) that the server briefly has to do something. So, 100 DB connections should be enough for more than 100 users.

In reply to Tim Hunt

Re: Does max_connection=100 mean only 100 students simultaneously can attempt a quiz ?

by Mario Gharib -

Dear Tim, thanks for your quick and helpful reply,

One more questions, what do they mean by shared_buffers = 32MB in the PostgreSQL configuration file ?