Skip to content

Instantly share code, notes, and snippets.

@saaj
saaj / Dockerfile
Last active May 10, 2020 10:41
Python3 MySQL adapter benchmark
FROM ubuntu:trusty
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8
RUN apt-get update -q
RUN apt-get install --no-install-recommends -qy \
mysql-server libmysqlclient-dev python3-pip python3-dev build-essential
RUN apt-get install --no-install-recommends -qy wget
RUN pip3 install mysqlclient pymysql pytest-benchmark
@saaj
saaj / HISTORY.rst
Last active May 10, 2020 10:43
Example of using thread and process pools to make parallel queries to MySQL
@saaj
saaj / HISTORY.rst
Created April 26, 2020 20:04
Development MySQL server and administrative UI
@saaj
saaj / HISTORY.rst
Created April 26, 2020 20:05
Local DynamoDB and simplistic administrative UI
@saaj
saaj / .bash_aliases
Last active May 10, 2020 09:13
Bash alias for process group RSS percentage via termsql
alias topmem='smemstat -sm | termsql -01 -r 6 -T 3 "SELECT SUM(PSS) as PSS, SUM(RSS) as RSS, Command \
FROM tbl GROUP BY Command ORDER BY SUM(PSS) DESC LIMIT 5" | column -t -s "|"'
alias topmemps='ps -x -o rss,%mem,cmd | termsql -m tabs -01 "SELECT SUM(rss) / 1024 as RSS, SUM([%mem]) AS PCT, cmd \
FROM tbl GROUP BY cmd ORDER BY SUM(rss) DESC LIMIT 5"'
@saaj
saaj / HISTORY.rst
Created April 26, 2020 20:10
SQLite3 multi-value bulk insert PK generation consequence test