Skip to content

Instantly share code, notes, and snippets.

View ThomasFlorelli's full-sized avatar

Thomas Florelli ThomasFlorelli

View GitHub Profile
@MateusBMP
MateusBMP / print-mem.sh
Created June 18, 2021 01:38
Show memory usage of mysql, by Thomas Florelli
#!/bin/sh
# see: https://tech.labelleassiette.com/how-to-reduce-the-memory-usage-of-mysql-61ea7d1a9bd
# you might want to add some user authentication here
mysql -e "show variables; show status" | awk '
{
VAR[$1]=$2
}
END {
MAX_CONN = VAR["max_connections"]