- Local env setup
- Bonus: CloudSQL methods
- Configuration: most useful configs for balanced performance
- Basics of query dynamics:
- How a Query Works
- JOINs
This document tries to combine basic/general query and commands that can be useful for database maintenance and monitoring.
Here you can list active/iddle connections to the database and see the actual queries that hit the DB.
Note: If there are too much concurrent requests to your database server (not to a single DB instance), than you should consider reducing iddle connections. Especially if there are too much old iddle connections.
SELECT * FROM pg_stat_activity;
See talk
- use application_name in qs (if more than one app connects to db)
- Native Partitioning is better than pg_partman
=> The more you log, the better you locate performance battlenecks. Also the mor you log, the more you slow down your system.
=> pgbadger, pg_stat_statements (what is currently happening)
You can refer to oficial documentations to install related component (or all of them)
- Docker For Desktop (MacOS, Windows)
- minikube
- Helm
- Kind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
master_merge(){ | |
TARGET_BRANCH = $1 | |
if [[ $# -eq 0 ]] ; then | |
echo "\033[41;37;1m Usage: mm name_of_branch !!! \033[0m" | |
exit(1) | |
fi | |
echo "\033[41;37;1m Fetch/pull master and merge into $TARGET_BRANCH !!! \033[0m" | |
git checkout master | |
git pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:gunicorn] | |
command=/bin/gunicorn -w 4 myapp:app | |
environment=MY_ENV=/var/null | |
user=www-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval_docker_machine(){ | |
MACHINE_NAME = $1 | |
if [[ $# -eq 0 ]] ; then | |
echo "\033[41;37;1m Usage: edm name_of_machine_env !!! \033[0m" | |
exit(1) | |
fi | |
echo "\033[41;37;1m Eval to Docker-machime for $MACHINE_NAME !!! \033[0m" | |
docker-machine ls -t 30 | |
docker-machine env $MACHINE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew update | |
# Change default shell to zsh :) | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
# To Install PHP 5.6 | |
#Setup the homebrew/dupes tap which has dependencies we need: |
NewerOlder