Skip to content

Instantly share code, notes, and snippets.

@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
@ca4ti
ca4ti / crossover-howtocompile.md
Created May 2, 2024 08:16 — forked from sarimarton/crossover-howtocompile.md
CodeWeavers CrossOver - How to compile from source! for macOS

UPDATE 2023-01-22 21:34:33

This guide was last tested on an Intel MacBook 2017. Since then it's unmaintained and won't be updated (I quit the game and bought a life-time crossover licence).


This has been forked from https://gist.github.com/Alex4386/4cce275760367e9f5e90e2553d655309

For the latest discussion, see the comments there.

@ca4ti
ca4ti / crossover-howtocompile.md
Created April 9, 2024 09:09 — forked from Alex4386/crossover-howtocompile.md
CodeWeavers CrossOver - How to compile from source! for macOS

[STOP] This gist is deprecated.

TL;DR

WAY MORE UP-TO-DATE GIST (and includes some setup stuff that I forgot to document): https://gist.github.com/sarimarton/471e9ff8046cc746f6ecb8340f942647
Current Development for Building Libre-version of CrossOver: https://github.com/GabLeRoux/macos-crossover-cloud-build.
For Latest Discussions: https://github.com/GabLeRoux/macos-crossover-cloud-build/issues.

Long Description

This version of gist is outdated since it was written while I was compiling CrossOver v19. and seems to be there are some breaking changes in v19.1+ and 20. Also, I think I missed some required libraries/stub files that was required in build (that I previously installed beforehand). Oops.