Moodle and pgpool

Moodle and pgpool

ដោយ Tak Auyeung នៅ
ចំនួនតប៖ 7
I am evaluating options to improve the performance of Moodle. Can anyone confirm, one way or another, whether pgpool can be used with Moodle? Specifically does Moodle contain SELECT queries that have side effects, or UPDATE or INSERT queries that have undeterministic functions like "random"?

I did a quick grep and couldn't find anything that rules out pgpool (or will require modification).

Thanks in advance for any information!
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Tak Auyeung

Re: Moodle and pgpool

ដោយ Martín Langhoff នៅ
> SELECT queries that have side effects

Some SELECTs move sequences forward.
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Martín Langhoff

Re: Moodle and pgpool

ដោយ Tim Hunt នៅ
រូបភាព Core developers រូបភាព Documentation writers រូបភាព Particularly helpful Moodlers រូបភាព Peer reviewers រូបភាព Plugin developers
They do? wow! how is that possible?
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Tim Hunt

Re: Moodle and pgpool

ដោយ Penny Leach នៅ
iirc, pgpool is not smart enough to differentiate between SELECTs that bump sequences and SELECTs that retrieve data only.


Eg select nextval('foo_id_seq') is treated as a readonly query.
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Penny Leach

Re: Moodle and pgpool

ដោយ Valery Fremaux នៅ
Penny, would you say pgpool (we try using pgpool-II) would not be usable for postgress replicates with Moodle ? Some one knows about another way having real synchronous clustering on Postgres
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Valery Fremaux

Re: Moodle and pgpool

ដោយ Penny Leach នៅ
I've had a few discussions about using pgpool before, and the general consensus was it doesn't have enough built-in smarts to differentiate between reads and writes at this point.

You would really have to handle this at the application level by making the database abstraction layer be aware of reads vs writes and behave accordingly (send writes to all databases, fetch reads from a pool)

In Moodle, 99% of the queries go through a function that knows whether it is read or write (get_records vs insert_record) for example, but that doesn't solve the problem of sending raw sql (execute_sql for example).

You end up either having to parse the query in the database abstraction layer (bad, because as above, SELECTs can actually be writes), or in the pgpool layer (bad, because it doesn't, but is philosophically a better place for it), or in the caller to the database abstraction layer, I mean, where the sql is written (good, because that place knows what sort of query it is -read or write, but bad because it really should be handled somewhere more central).
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Penny Leach

Re: Moodle and pgpool

ដោយ Valery Fremaux នៅ

Penny, we are resulting working on the same project -> Jonathan !! How funny life is... how great moodle community ... ញាក់ចិញ្ចើម

Cheers.

មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Valery Fremaux

Re: Moodle and pgpool

ដោយ Penny Leach នៅ
Yes I made that connection shortly after posting my reply yesterday too! ញញឹម
មធ្យមភាគនៃរង្វាយតម្លៃ: -