Skip to content

Instantly share code, notes, and snippets.

View HarshadRanganathan's full-sized avatar
💭
Buy me a coffee (https://ko-fi.com/harshadranganathan)

Harshad Ranganathan HarshadRanganathan

💭
Buy me a coffee (https://ko-fi.com/harshadranganathan)
View GitHub Profile
@HarshadRanganathan
HarshadRanganathan / commands.md
Created December 1, 2021 22:55
Kubernetes Jump Pod for MongoDB

[1] Create Ubuntu Pod

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: ubuntu
  labels:
    app: ubuntu
@HarshadRanganathan
HarshadRanganathan / RDS.md
Last active April 4, 2022 09:08
AWS Service Checklist/Practices
  • Single-master cluster
  • 1 write and 1 read/replica node
    • Write node r5.8xlarge instance
    • Replica/Read node r5.8xlarge instance
  • Engine version: 5.7.mysql_aurora.2.07.5 (LTS)
  • Replica/Reader node in different AZ - Fast failover and high availability
  • Subnet groups - private subnets in different AZs
  • RDS Data API
  • Event Subscriptions
  • Maintenance Window
@HarshadRanganathan
HarshadRanganathan / aws_credentials
Created September 19, 2021 11:39
Sample AWS Credentials File
[prod]
credential_process = python /Users/test/aws_cli_saml_ping_v2/authenticate.py --credential-process --username test --role arn:aws:iam:::role/Read
export JAVA_HOME_8=$(/usr/libexec/java_home -v1.8)
export JAVA_HOME=$JAVA_HOME_8
[[ -s "/Users/hrangana/.gvm/scripts/gvm" ]] && source "/Users/hrangana/.gvm/scripts/gvm"
1. I see that most of your connections and queries are running on the master(writer) database instance itself without much load on the reader instance. You can consider dividing your workload such that read-only queries/workloads are directed to the reader instance, and only write queries are handled by your writer instance. This will help alleviate the large undo logs(RollbackSegmentHistoryListLength) due to long running queries and in itself this should mitigate a lot of the performance issues.
One way to achieve splitting of Reads and Writes is by making use of a third party software Proxy solution which can split reads and writes to the appropriate endpoints. Below are a few example software solutions which you can consider:
[+] ProxySQL - https://proxysql.com/
[+] Heimdall Data - https://www.heimdalldata.com/
2. If and where possible, try to split large transactions into multiple smaller transactions. This will again reduce the growth of the undo log which seems to be the main cause of t
@HarshadRanganathan
HarshadRanganathan / docker_commands
Created January 11, 2021 12:15
Docker commands
# Run Docker Local Registry
docker run -d -p 5000:5000 --restart=always --name registry registry:2
@HarshadRanganathan
HarshadRanganathan / .zshrc
Last active August 31, 2022 10:08
Zsh Profile
# Fig pre block. Keep at the top of this file.
. "$HOME/.fig/shell/zshrc.pre.zsh"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/harshad/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
// convert all files to webp format with quality ratio of 80
for file in img/*; do cwebp -q 80 "$file" -o "${file%.*}.webp"; done
// convert images based on google's recommended sampling factor, quality and interlace
magick mogrify -sampling-factor 4:2:0 -strip -quality 75 -interlace JPEG -colorspace RGB -format jpg *.png
magick mogrify -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB *.jpg
@HarshadRanganathan
HarshadRanganathan / settings
Last active July 2, 2020 21:59
Windows Terminal Settings
// This file was initially generated by Windows Terminal 0.11.1191.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",