9

I am assuming it's possible to slow down the query access of a specific user in a postgres database. How would you do It? Is there a way for the user to see that such a setting has been placed on them, and what might the user do to overcome it, if anything at all.

Basically I'm interested in throttling resources on a per user basis to prevent bad actors from abusing the system.

asked Oct 16, 2017 at 16:24
0

1 Answer 1

5

To my knowledge, vanilla Postgres does not natively offer these features within the engine. Per the Priorities PostgreSQL wiki page:

PostgreSQL has no facilities to limit what resources a particular user, query, or database consumes, or correspondingly to set priorities such that one user/query/database gets more resources than others. It's necessary to use operating system facilities to achieve what limited prioritization is possible.

As the last sentence alludes to though, there are ways to simulate this behavior by using connection settings (e.g. work_mem and maintenance_work_mem for memory) or OS level tricks with the help of extensions (e.g. prioritize for CPU prioritization).

If you've got a budget, there are customized Postgres engines that claim to provide this functionality as well, one of which is offered by EnterpriseDB. I haven't used it nor do I have any idea how well it performs, but it's another option if you're looking for more alternatives.

answered Oct 16, 2017 at 17:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.