Moodle and Postgres: Performance problems

Moodle and Postgres: Performance problems

by Marcelo Lopes -
Number of replies: 3
Hi, that's the first time I post a question here. I'm from Brazil, so, please be patient with my English. piscando
We're experiencing some performance issues here on our Moodle installation. SO, web server and support guys have tested and tunned our Linux distro and Apache, our hardware is new, we are using Moodle 1.9.2, PHP 5.1.6 and PostgreSQL 8.1.11. Anyway, we are not currently using any type of PHP accelerators or memory cache software (yet). I know it's hard to talk about "concurrent users", but what I can say for sure is that we have 4 schools that are accessed and heavily used all the day for students from entire country and even from Latin America.
The fact is: Our DB support team claims Moodle is opening a large number of database connections.

Anyway, I wanna know what can be changed on Moodle configuration to improve database (and specifically, PostgreSQL) performance.

This line on config.php

$CFG->dbpersist = true;

may be useful on this case?
Does Moodle use some kind of connection pool?


Best regards and thanks for any help,

Marcelo Lopes.
Average of ratings: Useful (1)
In reply to Marcelo Lopes

Re: Moodle and Postgres: Performance problems

by Penny Leach -
Hi Marcelo,

There is a very good performance guide in moodledocs: http://docs.moodle.org/en/Performance which includes some information about how to tune both postgres and apache.

Specifically regarding your question about connection pooling - you can tell Moodle to use persistent connections, but a better approach is possibly to install a tool called "pgtool". You need to switch postgres over to listen on a different port (usually 5433) and tell pgpool to listen on 5432 which is the normal postgres port. There, it pools connections and acts as a buffer between postgres and whatever is using it.

Other than that, you might want to upgrade to postgres 8.2 - you should see some performance improvements over 8.1

Cheers,
Penny
Average of ratings: Useful (2)
In reply to Penny Leach

Re: Moodle and Postgres: Performance problems

by Marcelo Lopes -
Hi Penny,

Sorry if I spend so much time to say thanks! We use this Moodle performance guide as its name says: a guide for our researches.

Best regards,

Marcelo.