TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to Find and Stop Running Queries on PostgreSQL

125 点作者 j4mie将近 3 年前

7 条评论

superb-owl将近 3 年前
This process has saved me from an outage more than once.<p>I keep a dashboard of running pids, and get alerts when any of them take more than N minutes (excepting autovacuum). Once every few months I have to psql into prod and cancel one.
评论 #31817280 未加载
评论 #31816277 未加载
unnouinceput将近 3 年前
Quote: &quot;Windows does not have a kill command...&quot;<p>Yes, she does. It&#x27;s called &quot;taskkill&quot;
评论 #31819682 未加载
评论 #31819652 未加载
natmaka将近 3 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;dalibo&#x2F;pg_activity" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dalibo&#x2F;pg_activity</a> (&#x27;a top-like application for PostgreSQL server activity monitoring&#x27;) is quite useful.
faizshah将近 3 年前
This is really nice, are there any preventative measures one could take as well? For example setting a max query run time or something like that?
评论 #31819018 未加载
aidos将近 3 年前
Ooohh. That pg_blocking_pids(blockedpid) function is a nice one to add to the arsenal.
SnowHill9902将近 3 年前
How can you find and stop users which are accessing a certain table?
评论 #31817985 未加载
devoutsalsa将近 3 年前
There’s always “sudo reboot”, too :)