Monthly Archives: November 2013

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

Amazon Web Services: Free Tier

Amazon Web Services cloud platform logo

How do you get started with AWS for free?
Just go to https://aws.amazon.com/free/ and create your account.
A credit card is required, even for a free account.

Historical Context (2013): When this article was written, AWS Free Tier offered t1.micro instances with 613 MB of RAM. Modern AWS Free Tier accounts provide t2.micro / t3.micro instances (1 GB RAM) for 12 months plus selected Always Free allowances (such as DynamoDB and AWS Lambda).

What can you do with the free account?
It’s up to you! If you are building a light-traffic website, the Free Tier can handle it. 🙂

You can have up to two EC2 instances (1 Linux, 1 Windows) with 613 MB of RAM and up to 30 GB of EBS storage. You can use all 30 GB on a Linux instance, which is the best way to spend your “free” resources (Windows is memory-hungry).

You can have up to one RDS instance (PostgreSQL, MySQL, …) with 20 GB of database storage and 20 GB for backups.

You can use Amazon S3 with up to 5 GB of storage and up to 20k PUT and 20k GET requests.

You can have up to one Memcached node with 213 MB of RAM.

And a few other services (ELB, DynamoDB, SNS, CloudWatch, …).

Continue reading

Check your website performance

Web performance audit magnifying glass over global network icon

WebPageTest, GTmetrix, PageSpeed Insights, and Website Grader can test your website and web server and help you see if you are using optimal configurations!