Tuning Your DBMS Automatically with Machine Learning
aws.amazon.com
aws.amazon.com
The default of 128mb is plain stupid. I get why Amazon chose it, because it directly eats 2x the value of your backing store - something that can be hard to explain to customers with 4gb disks attached and not really running any appreciable load through it.
But when you have 100+ gig disks allocated on a 2xlarge instance, the small value makes no sense whatsoever.
It took me about 2 weeks of internet scavenging to find the culprit, which was just the innodb_buffer_pool_size size. That was my first commercial project I worked on for the employer and it got me the reputation of THE db performance tunning expert in the company. I was with them for 5 years and that was a quick&easy way to position myself as a valuable team member.
In the article: "and collects its Amazon EC2 instance type and current configuration"
... and I switched off.
I recently diagnosed a MySQL latency snag on a well known cloudy platform for a customer. I run rather a lot of comparative bonnie++, MySQL bench and Lord knows what else. I was able to convince the customer that my office PC ran MariaDB better simply because my single SSD on a rather shag Lenovo PC (a cast off from another customer!) had better i/o and latency than whatever they were being given by said cloudy provider.
I suggest you start with the basics: CPU, RAM, disc I/O and latency, network I/O and latency. Optimise those first and then work up the stack (and down, then back up etc.)
If you start with "assume a spherical EC instance" you may not be considering the whole problem -> solution -> realisation thing.
(Not that I agree with your diatribe against cloud providers. They all have options with excellent performance, such as locally-connected SSDs)
"Now you can trade not having a DBA, and letting your programmers not get criticized by him for paying us $$$($$$$$$$$$$$$$$). DBA's bad ! Bad ! BAD I tell you".
I fixed a customer's database a few months back. It was a cloud sql instance. They paid cloudy provider $40k for hosting a ~130 MB database (in ~ 8 months) before getting a consultant to look at it. I charged them $2k for an afternoon of hacking onsite and 2 days of followup, and they were ecstatic to pay it, saying that not doing that for 2 more weeks would have been more expensive. They're now paying the minimum charge for that and 5 other databases.
Most of the cloudy database offerings are ridiculously expensive for small, infrequently accessed databases (0.1 to 0.01 qps, let's be honest there's a boatload of these in every company), compared to either hosting it yourself or getting a small shared hosting or dedicated provider to do it.
I often wonder if a lot of the cloud scaling isn't being pushed by these companies for the same reason. Using a distributed publish-subscribe queue will seriously slow down anything that doesn't require, say ~5-10 machines, to execute.
- Purchasing the kit and waiting for delivery. Probably a few weeks BUT that's a few weeks of no extra work on your part, just waiting. You still need to fill in the PO, get it signed off by your CTO, whatever
- Racking and powering. Except on the biggest jobs, 1-2 days for a DC team of physical labour.
- Installing an OS and software. These days, a few hours, PXE boot then let CFEngine or whatever do it
For everything else, you still need someone to either do it or take responsibility for it being done and verified and documented and reviewed to see if it's still the right solution and so on and so on. As I always say "if you don't have a DBA then YOU are the DBA".
Incidentally "you don't need a DBA anymore" was also the pitch of MongoDB et al... Careful devs, one day it will be your turn :-)
Whereas as long as you e.g. "keep it postgres", you're able to experiment (at fairly low effort) with different database setups and find what is more efficient or cost effective for you. If Cloud Provider X's pricing model starts to deviate from what people are able to achieve with some custom database setup, people will start flocking to that - and, in fact, Cloud provider X would probably find themselves competing with an easy to use "managed database" service that does just that on their own Cloud Marketplace.
Not that this isn't an extremely interesting project as long as it's possible to wrestle the concept free from Amazon's infrastructure.
The default configuration for MySQL is for a server with 512M RAM: https://dev.mysql.com/doc/refman/5.7/en/memory-use.html
.. so some improvement should be expected. The paper shows what has been tuned in each configuration (pasting below).
It would be diligent to point out that the DBA configuration actually changes the semantics so you may lose data (disabling doublewrite, flush-log-at-trx-commit=0).
(a) OtterTune Configuration (MySQL)
=============================
innodb_buffer_pool_size 8.8 G
innodb_thread_sleep_delay 0
innodb_flush_method O_DIRECT
innodb_log_file_size 1.3 G
innodb_thread_concurrency 0 # this is the default
innodb_max_dirty_pages_pct_lwm 0 # this is the default
innodb_read_ahead_threshold 56 # this is the default
innodb_adaptive_max_sleep_delay 150000
innodb_buffer_pool_instances 8 # this is the default
thread_cache_size 9 # this is the default
(b) DBA Configuration (MySQL)
=========================
innodb_buffer_pool_dump_at_shutdown 1
innodb_buffer_pool_load_at_startup 1
innodb_buffer_pool_size 12 G
innodb_doublewrite 0
innodb_flush_log_at_trx_commit 0
innodb_flush_method O_DIRECT
innodb_log_file_size 1 G
skip_performance_schema
(c) Tuning Script Configuration (MySQL)
==============================
innodb_buffer_pool_instances 4
innodb_buffer_pool_size 4 G
query_cache_limit 2 G
query_cache_size 2 G
query_cache_type 1
(d) Amazon RDS Configuration (MySQL)
===============================
innodb_buffer_pool_size 10.9 G
innodb_flush_method O_DIRECT
innodb_log_file_size 128 M
key_buffer_size 16 M
max_binlog_size 128 M
read_buffer_size 256 k
read_rnd_buffer_size 512 M
table_open_cache_instances 16
thread_cache_size 20