https://github.com/achanda/pg_power
https://github.com/achanda/pg_power
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/achanda/pg_power
- Owner: achanda
- Created: 2024-12-18T03:18:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-18T15:56:59.000Z (over 1 year ago)
- Last Synced: 2024-12-18T16:45:12.287Z (over 1 year ago)
- Language: C
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> :warning: **Do not run this in production or in any secure system**
To run this, make sure the postgres binary can read the RAPL file
```
sudo setcap cap_dac_read_search=+ep /usr/lib/postgresql/14/bin/postgres
```
Sample output from the postgres server
```
abhishek@guest:~$ /usr/lib/postgresql/14/bin/postgres --config-file=$(pwd)/pgdata/postgresql.conf -D $(pwd)/pgdata -k $(pwd)/pgdata
2024-12-18 03:13:00.490 GMT [1751699] LOG: starting PostgreSQL 14.13 (Ubuntu 14.13-0ubuntu0.22.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
2024-12-18 03:13:00.490 GMT [1751699] LOG: listening on IPv6 address "::1", port 5432
2024-12-18 03:13:00.490 GMT [1751699] LOG: listening on IPv4 address "127.0.0.1", port 5432
2024-12-18 03:13:00.492 GMT [1751699] LOG: listening on Unix socket "/home/abhishek/pgdata/.s.PGSQL.5432"
2024-12-18 03:13:00.494 GMT [1751700] LOG: database system was shut down at 2024-12-18 03:12:28 GMT
2024-12-18 03:13:00.498 GMT [1751699] LOG: database system is ready to accept connections
2024-12-18 03:13:09.611 GMT [1751715] LOG: Query execution starting: 69877598944
2024-12-18 03:13:09.611 GMT [1751715] STATEMENT: select 1+1;
2024-12-18 03:13:09.611 GMT [1751715] LOG: Query execution completed: 3785
2024-12-18 03:13:09.611 GMT [1751715] STATEMENT: select 1+1;
^C2024-12-18 03:13:21.466 GMT [1751699] LOG: received fast shutdown request
2024-12-18 03:13:21.469 GMT [1751699] LOG: aborting any active transactions
2024-12-18 03:13:21.469 GMT [1751715] FATAL: terminating connection due to administrator command
2024-12-18 03:13:21.471 GMT [1751699] LOG: background worker "logical replication launcher" (PID 1751706) exited with exit code 1
2024-12-18 03:13:21.472 GMT [1751701] LOG: shutting down
2024-12-18 03:13:21.481 GMT [1751699] LOG: database system is shut down
```