okfn-brasil / jarbas

🎩 API for information and suspicions about reimbursements by Brazilian congresspeople
https://jarbas.serenata.ai/
296 stars 61 forks source link

Try lower `random_page_cost` on Postgres #301

Closed cuducos closed 6 years ago

cuducos commented 6 years ago

What is the problem? A bottleneck for Jarbas is Postgres performance. This article suggests that setting random_page_cost lower works well when using SSD (which is our case).

How can this be addressed? First compare some queries (special the ones from the Jarbas Dashboard) execution time with random_page_cost=4 (default) and random_page_cost=1. If it really works, we need to adapt our Docker architecture to start the service with that custom setting.

Who could help with this issue? Not sure… maybe @caduvieira? @fredgcosta?

caduvieira commented 6 years ago

Does the performance improved?

cuducos commented 6 years ago

Does the performance improved?

Yep. I just ran simple tests locally and it was slightly quicker — nothing so surprising as in the reference, but worth it ; )

caduvieira commented 6 years ago

There are other recommendations on https://speakerdeck.com/ongres/postgresql-configuration-for-humans

cuducos commented 6 years ago

Closed by #303