Score:0

How can I make postgres startup on connection - and shutdown after a period of being out of use?

bd flag

In the day time I do software development where I use Postgres via Django on Ubuntu.

In the evening the computer is my personal laptop (still running Ubuntu).

How can I make Postgres startup when it receives a connection, and shut down if there is no activity for a while ?

I use systemd run services - so I imagine the startup part must be relatively straightforward ?

in flag
Development environments are off topic. I'd try to check if this is doable with inetd/xinetd though.
in flag
What do you want to save by doing so RAM or CPU? Cpu usage should be little unless the server has some task for self optimizing it's data (not sure if postgres has something like this). And RAM should be just a configuration option to minimize usage if the server is idle.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.