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 / .gitconfig
Created March 20, 2019 15:27
.gitconfig aliases
[alias]
##
# One letter alias for our most frequent commands.
#
# Guidelines: these aliases do not use options, because we want
# these aliases to be easy to compose and use in many ways.
##
a = add
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 / eks-upgrade-1.20-to-1.21.groovy
Created September 2, 2022 20:22
EKS Upgrade Jenkins Pipeline Scripts
#!/usr/bin/env groovy
final List<String> environments = Env.values().collect() { it.name() }
pipeline {
agent {
label any
}
parameters {
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
@HarshadRanganathan
HarshadRanganathan / emr.sh
Created October 24, 2023 09:38
Script to extract EMR jobs run using a particular Release Label
#!/bin/bash -xe
QUERIED_RELEASE="emr-5.29.0"
REGION="us-east-1"
LIST_CLUSTERS_COMMAND="aws emr list-clusters --region $REGION"
COUNTER=0
function CALL_API() {
if [ ! -v NEXT_TOKEN ]; then
CLI_OUTPUT=$($LIST_CLUSTERS_COMMAND)
# Installs a git helper function which retrieves the password or developer token from Secrets Manager
# directly for cloning a repository from a private git repo or pushing back changes upstream.
# Storing passwords and tokens in Secrets Manager eliminates the need to store any sensitive information on EFS.
# Steps:
# 1. Add your password or personal developer token to Secret Manager
# 2. Set the secret name, key & email in the script below
# 3. Clone your repository via HTTP with the user name in the url, e.g. "git clone http://username@github.com/...."
#!/bin/bash
@HarshadRanganathan
HarshadRanganathan / README.md
Last active June 3, 2023 18:36
Github Actions Notes
  • Context variables - availability varies based on workflow step
    • github e.g. ${{ github.actor }}
    • env
    • vars
    • job, jobs
    • steps
    • runner
    • secrets
    • strategy
  • matrix
@HarshadRanganathan
HarshadRanganathan / README.md
Last active May 11, 2023 10:00
AWS Cost Optimizations

S3

  • Enable Storage Lens
  • Enable Intelligent Tiering
  • Delete Incomplete Multipart Uploads
  • Expire Non-Current Versioned Objects
  • Add Lifecycle Rules

Lambda

@HarshadRanganathan
HarshadRanganathan / scripts.mysql
Last active April 15, 2023 11:30
MySQL Scripts
/* Get currently running transactions */
select * from information_schema.innodb_trx
/* Get currently running transactions where tables in use */
select * from information_schema.innodb_trx where trx_tables_in_use = 1
/* show locked tables */
show open tables where in_use > 0 ;
SHOW ENGINE INNODB STATUS;