Skip to content

Instantly share code, notes, and snippets.

View zhangysh1995's full-sized avatar
🤣
I have a 150-star repo now!

Yushan zhangysh1995

🤣
I have a 150-star repo now!
  • Tencent
  • Shenzhen, China
  • 18:00 (UTC +08:00)
View GitHub Profile
@zhangysh1995
zhangysh1995 / deadlock-detection.md
Created December 27, 2019 08:22 — forked from shantanusingh/deadlock-detection.md
Debugging Deadlocks in PostgreSQL

Queries For Deadlock Detection

select pg_class.relname,pg_locks.* from pg_class,pg_locks where pg_class.relfilenode=pg_locks.relation;

select * from pg_locks;

select * from pg_locks where granted = 'f' //the query that is waiting
select * from pg_locks where transactionid = 'xx' // queries running in a transaction
select * from pg_stat_activity

@zhangysh1995
zhangysh1995 / docker_rabbitmqctl.md
Created March 1, 2018 02:54 — forked from jemc/docker_rabbitmqctl.md
Controlling Docker RabbitMQ via rabbitmqctl

Example invocation of a RabbitMQ docker container (use -d instead of -t -i to run in the background):

sudo docker run -t -i --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

Example of controlling the rabbitmq-server inside the container using rabbitmqctl (also inside the container).

sudo docker exec rabbitmq su rabbitmq -- /usr/lib/rabbitmq/bin/rabbitmqctl status