View Post

MySQL Performance Troubleshooting Crash Course. A Story Of One Sneaky MySQL Performance Bug

In MySQL by Aurimas Mikalauskas0 Comments

What better way to learn the basics of MySQL Performance Troubleshooting, than by observing a MySQL expert troubleshoot a nasty MySQL 5.7 performance bug, that a team of DBAs were chasing for weeks before giving up and calling in an external consultant for help.

The bug was causing roughly 2 minute long lock-ups for all MySQL write queries at seemingly random 20-30 hour intervals and it took me (the external consultant) only 4 hours to uncover the issue (and a couple more to find and showcase a solution). Read More

View Post

Troubleshooting MySQL Performance. Step Zero: Check If You Have a Performance Problem to Troubleshoot

In MySQL by Aurimas Mikalauskas1 Comment

I lost count of the number of times I had customers come to me for a regular MySQL performance check-up saying “no, we don’t have any performance problems right now”, just to find they do actually have them, they’re just not aware of it. It’s no big surprise this happens when you’re not using your system as actively as your users are.

So let me share with you one trick I’m using to quickly check if the system I’m on has any problems that need troubleshooting. Actually, it’s dead simple. And no, it’s not a slow query log, it’s Threads_running. Let me show you.
Read More

View Post

17 Key MySQL Config File Settings (MySQL 5.7 proof)

In MySQL by Aurimas Mikalauskas5 Comments

When MySQL becomes too slow (or too unstable), temptation usually is to tweak the MySQL configuration file. Indeed, it’s a good place to start. But if you ever looked at the available configuration options, you know things can get messy – MySQL now has over 450 configuration variables for your consideration, that are not classified in any way, and neither of them are included in the stock my.cnf. It’s hard to know where to start! Read More

Running Elasticsearch in Production. The Ultimate Checklist

In Elasticsearch by Aurimas Mikalauskas0 Comments

elastic-graph
Running Elasticsearch in dev and production is day and night difference. For dev, you just run “elasticsearch” and you’re done. In production, you would almost never run one instance anyway, but there’s a lot more you need to do and check when running a production Elasticsearch cluster.

Here’s a quick checklist for you to go over every now and again, if you don’t want to get into trouble with your cluster: Read More

Quick way to improve Elasticsearch performance on a single machine

In Elasticsearch by Aurimas Mikalauskas0 Comments

It’s hard to find a server that has less than 4 cores and at least 2 disks these days. Multi-core, multi-disk environments have now become a commodity, yet not all software is built (or, in some cases, configured out of the box) to make the best use of that. Moreover, measuring and instrumenting such systems properly has become increasingly complex, which is why this has been one of the most interesting topics that I give talks in various tech conferences on.

Elasticserach is not an exception. Yes, it is multi-threaded and it does make a pretty good use of available CPUs or disks, especially at high concurrency environment. But. If you want your queries to return faster using as much CPU or Disk capacity as they possibly can, there’s something you can do about it. Read More

Apache -vs- Nginx. 2015 Edition

In Web Servers by Aurimas Mikalauskas1 Comment

apache -vs- nginx
The choice used to be clear:

  • You want convenience – go with Apache
  • If you want speed – then it’s Nginx

Or lighttpd. Or whatever, but NOT Apache web server. Sometimes they were even used in conjunction – Nginx on the front, to spoon-feed slower client connections and serve static content (using almost no memory for that), and Apache at the back, to generate dynamic content.

Digital ocean has covered the practical considerations of running one or the other (or both) very nicely, so I’m not going to. What I am going to tell you though is that it is outdated. Long gone the days when Nginx had a significant advantage over Apache. Read More