Skip to content

Instantly share code, notes, and snippets.

@ca4ti
ca4ti / createdb-with-locale.sh
Created October 2, 2024 19:22 — forked from khoazany/createdb-with-locale.sh
Create a new PostgreSQL database with UTF8 encoding
#Replace 'symplcms' with the database'name
createdb --template=template0 --locale=en_US.UTF-8 --encoding=UTF8 -U postgres symplcms
@ca4ti
ca4ti / DBeaver Ultimate Keygen
Created October 2, 2024 19:01 — forked from proslemitowm/DBeaver Ultimate Keygen
DBeaver Ultimate 24.0.0.202403110838 Crack License Key [2024]
DBeaver Ultimate License Key
@ca4ti
ca4ti / conclusion.md
Created September 23, 2024 19:24 — forked from LeonStoldt/conclusion.md
Postgres Optimization and Performance Tuning

Postgres Optimization and Performance Tuning

based on the following article: An Introduction to PostgreSQL Performance Tuning and Optimization

Resource Usage

  • huge pages: Enabling on Linux will give a performance boost to PostgreSQL (VMPeak / HugePageSize = 4310)
  • max_connections: optimal number is roughly 4 times the number of CPU cores. The recommended number is the GREATEST(4 x CPU cores, 100). Beyond this number, a connection pooler such as pgbouncer should be used. avoid setting max_connections too high as it will increase the size of various data structures in Postgres which can result in CPU cycles being wasted
  • shared_buffers: variable by workload - starting Point: LEAST(RAM/2, 10GB).
  • work_mem: ((Total RAM - shared_buffers)/(16 x CPU cores))
  • maintenance_work_mem: 1GB good start
  • effective_io_concurrency: SSD = 200, HDD = Number of Disks
@ca4ti
ca4ti / lxd-usage.txt
Created September 8, 2024 14:22 — forked from ruanbekker/lxd-usage.txt
LXD Usage
Docs - LXD Helpful Docs:
https://www.stgraber.org/2016/03/30/lxd-2-0-image-management-512/
https://www.flockport.com/flockport-first-look-at-lxd/
http://insights.ubuntu.com/2016/03/14/the-lxd-2-0-story-prologue/
Docs - Installation:
http://insights.ubuntu.com/2016/03/14/the-lxd-2-0-story-prologue/
Docs - API:
https://linuxcontainers.org/lxd/getting-started-cli/
@ca4ti
ca4ti / LXC-LXD-2.x-curl-API.md
Created September 8, 2024 14:19 — forked from jaytaylor/LXC-LXD-2.x-curl-API.md
HOWTO: Curl the LXD unix.socket file.

It is possible to use curl to query the LXD unix.socket directly:

curl --unix-socket /var/lib/lxd/unix.socket http:/1.0/containers | jq .

Example output:

{
@ca4ti
ca4ti / convert_ova_docker.md
Created August 31, 2024 11:36 — forked from ihatem/convert_ova_docker.md
Convert a VirtualBox ova file to a Docker image
@ca4ti
ca4ti / OpenSourceCRM.rst
Created August 23, 2024 20:56 — forked from cstroe/OpenSourceCRM.rst
A distilled list of open-source CRM software
@ca4ti
ca4ti / format.sh
Created June 21, 2024 15:13 — forked from garethrees/format.sh
Format USB drive from the command line macOS
diskutil list
diskutil unmountDisk /dev/disk2
diskutil eraseDisk FAT32 SANDISK /dev/disk2
@ca4ti
ca4ti / format.sh
Created June 21, 2024 15:13 — forked from garethrees/format.sh
Format USB drive from the command line macOS
diskutil list
diskutil unmountDisk /dev/disk2
diskutil eraseDisk FAT32 SANDISK /dev/disk2
@ca4ti
ca4ti / format.sh
Created June 21, 2024 15:13 — forked from garethrees/format.sh
Format USB drive from the command line macOS
diskutil list
diskutil unmountDisk /dev/disk2
diskutil eraseDisk FAT32 SANDISK /dev/disk2