Skip to content

Instantly share code, notes, and snippets.

@phund
phund / ZFS_and_ext4_Configuration.txt
Created December 27, 2022 04:56 — forked from dotmanila/ZFS_and_ext4_Configuration.txt
ZFS and ext4 Configuration
# Create ext4 RAID
sudo mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 \
--name=mysql /dev/sdb /dev/sdc /dev/sdd /dev/sde
sudo mkdir /mysql-ext4
sudo mkfs.ext4 /dev/md0
sudo mount -o rw,relatime /dev/md0 /mysql-ext4
sudo mkdir /mysql-ext4/msb
sudo chown revin.revin /mysql-ext4/msb
@phund
phund / postgres.md
Created May 23, 2023 04:54 — forked from webdestroya/postgres.md
Postgres commands for debugging

Process List

SELECT (NOW() - query_start) as duration, pid, usename, application_name, client_addr, client_port, backend_start, query_start,
wait_event, wait_event_type, state, query
FROM pg_stat_activity 
WHERE pid <> pg_backend_pid()
AND state <> 'idle'
ORDER BY query_start ASC;
@phund
phund / README.md
Created March 25, 2024 07:53 — forked from wvengen/README.md
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the