Skip to content

Instantly share code, notes, and snippets.

View pcaro's full-sized avatar

Pablo Caro pcaro

View GitHub Profile
@pcaro
pcaro / gist:4202916
Created December 4, 2012 11:35
Fabric posrgres tunning
def postgres_tunning(pgversion=9.1):
# Use postgres conservative values, for about 1GB RAM machine
# Following ideas from:
# * http://www.juancarlosmoral.es/postgresql-hardware-tunning
# * http://doc.nuxeo.com/display/ADMINDOC/Configuring+PostgreSQL#ConfiguringPostgreSQL-Performancetuning
# * http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server/es
fabtools.require.service.started("postgresql")
postgresql_conf = "/etc/postgresql/%s/main/postgresql.conf" % pgversion
@pcaro
pcaro / Better pg_dumpall (separated files)
Created December 4, 2012 11:26
Postgres simple backp
#!/bin/bash
# Puedes ver la fecha de la fecha en la cabecera de los .sqlc:
# pg_restore -l backupu.sqlc | head -n 15
# Echo: "Ejecutar este script como usuario con permisos (postgres)"
BKPDIR=postgres-backup-${DATE}
RSTFILE=restore.README
USER=postgres