Posts Tagged: MySQL

Powerful Redmine in AWS

In this post I will show how to install Redmine on AWS using several useful AWS services (EC2, RDS, S3, SES, ElastiCache) and make it auto-scalable.

Historical Note (2014): This walkthrough originally targeted Ubuntu 14.04 LTS (PV), Ruby 2.x, and Redmine 2.5. Inline corrections below fix command typos, YAML indentation, Apache XML tags, and insecure defaults for anyone referencing the architecture today.

Redmine

Continue reading

RDS Instance Sizes, maximum concurrent connections

Historical default max_connections limits across first-generation Amazon RDS MySQL instance classes:

RDS Instance ClassDefault max_connections
db.t1.micro34
db.m1.small125
db.m1.medium296
db.m1.large623
db.m1.xlarge1,263
db.m2.xlarge1,441
db.m2.2xlarge2,900
db.m2.4xlarge5,816

In RDS Parameter Groups, the dynamic formula defaults to {DBInstanceClassMemory/12582880} for MySQL and LEAST({DBInstanceClassMemory/9531392}, 5000) for PostgreSQL. On modern instance families (such as db.t3 and Graviton db.t4g), pooling connections with Amazon RDS Proxy prevents connection exhaustion from serverless or autoscaling workloads.

Amazon Relational Database Service (RDS) database icon

CLI Database optimization

Command-line database server optimization and maintenance icon

MariaDB & MySQL:

sudo apt install default-mysql-client   # or: mariadb-client
mysqlcheck -h yourdatabasehost -u root -p --auto-repair --check --all-databases
mysqlcheck -h yourdatabasehost -u root -p --auto-repair --optimize --all-databases
# Note: MariaDB 11+ also provides mariadb-check; --optimize rebuilds InnoDB tables, so schedule on busy databases carefully.

PostgreSQL:

vacuumdb -afvz -h yourdatabasehost -U postgres
reindexdb -a -h yourdatabasehost -U postgres

Updated (November 4, 2021): Docker example:

docker exec -it postgres-server vacuumdb -afvz -U postgres