MySQL in docker or native – performance benchmarks

Back in October I have write about possible ways of running multiple MySQL instances on the same hardware. As the months passing by, the project of splitting our database schemas into standalone instances is closing in, so I started to check the different ways.

EDIT: This post is outdated, here is the follow up.

Continue reading “MySQL in docker or native – performance benchmarks”

Continuous feedback from jenkins console output

This one really was a pain in the ass for a long time.

Jenkins is great, not only for building projects, but I start the most of the ops related tasks here. All the projects have their own workspace, I can browse the previous outputs, see if a task failed or not, and I can easily share the results at the end of the task.

I had only one problem with that: the long-running tasks weren’t shown on console output until they finished. I tried to solve that, but it was only annoying, not a showstopper, so I let that go, because it didn’t look like an easy win, and I didn’t want to spend too much time on that.

But last week I created a job for online altering the database and – surprise! – pt-online-schema-change was continuously updated the console log screen, so I started to google out what is happening.

Continue reading “Continuous feedback from jenkins console output”

“About the unix philosophy, and why I broke it – and then how I moved back to the old track”

I am always fascinated by the cleanliness of UNIX. One tool only should do one thing, but it has to be the best in that way. The operating system itself will glue all the modules together and give you a complex feel of a system, you don’t have to take care of huge, bloated software, don’t have to deal with mysterious bugs, which are appearing random. Just small bricks of clever software and the rest are on you.

Recently I broke this, and frankly, I am not sure if it was a bad decision, or not.

Continue reading ““About the unix philosophy, and why I broke it – and then how I moved back to the old track””

Streaming MySQL binary logs for backup

With MySQL, it is relatively easy to create “point in time” restores. All you need is recent(ish) backup and a bunch of saved binary logs. You can restore the backup you have, and when it is completed, you can use mysqlbinlog utility to apply your saved binary logs to the desired state of your database.

I have created a simple go application to make your life easier. You can find it on my GitHub page.

Continue reading “Streaming MySQL binary logs for backup”

My first impressions about Go language

I am fascinated. Maybe that should be enough, but I guess I have to write a bit more here because we are not on twitter.

I spent a few days to get know Go language, and now I am more than satisfied. I mean, all the project ideas which are floating in my head should be written in Go.

First of all, I have rewritten Mambo-collector to go (https://github.com/banyek/mambo) because I have faced some serious errors when I used it on CentOS 7 – I blame systemd -: If the process was running as root then after a few days of data collecting, killing that process was lead to restart the entire system, which is not a bug, it is a catastrophe. I tried to debug it several ways, but I am not sure where the problem is, it could be at the ‘loghandler’ redirection or any other place in python-daemon, or it is simply there is a buffer inside which overflows – I don’t really care, because mambo was just a proof of concept – what I used in production. I decided to abandon the project, and rewrite it in a language, what is designed for what mambo is: a system process with a high amount of parallel data processing. In the original version, I spawned an os thread for every query which will run (and we know that there is no real multithreading in python because of the global interpreter lock, at the end, building a multithreaded application in python is just an illusion. It is good for helping you to imagine what will happen inside your the computer, but you cannot expect real multithreading. It wasn’t a real problem because I only ran/run a few queries with mambo – replication lag, all processes inside mysql, active processes inside mysql – but if there would be a need to increase the number of queries that could lead to trouble. And it’s needless to say if you have a lot of time.sleep in your program, that is not the wisest use of your CPU resources: if a CPU is sleeping, then you waste resources.I have enough resources to let waste a bit, but it always disturbed me.

At the end, I decided to rewrite mambo in go.

Continue reading “My first impressions about Go language”

Fish shell brace expansion

I mentioned that I use the fish shell, but I would like to share a common problem of mine – well, so far this is the only one I found.

I commonly use commands like this

find . -maxdepth 1 -type d -exec du -sh {} \;

This works great with bash, but in fish, you got the following error message

 du: fts_open: No such file or directory

This happens because fish acts more aggressive on brace expansion than bash. It doesn’t treats it as a part of a command, but tries to expand it – but cannot succeed, because there is nothing.
Simply put that inside apostrophes and the shell will skip the brace expansion.

find . -maxdepth 1 -type d -exec du -sh '{}' \;

Not a big thing, but handy.

My work environment

I was thinking if my work environment would be interesting or not, but I decided ‘yes’ – because I always like reading about others work env.

I am working with Linux/UNIX for more than 15 years now, and I have tried a lot of cool tools, but at the end, I always found myself using the same apps in the terminal.

I like the Unix philosophy about Do One Thing and Do It Well. I never really use big, bloated software, I like to use my editor for editing files, and my git client to use git. That’s simple.

Continue reading “My work environment”

Running multiple instances on the same hardware

Currently, we have one database cluster with 15 different schemas – these schemas could be either schema which contains “real” data, or just schemas with metadata.

I guess the next evolutionary step of our database stack would be to split up the database cluster vertically along these schemas. All the data schemas should be moved to standalone mysql instances and put the metadata schemas next to them. This also could be a good project for prepare to move a certain part of the database for example to a cloud provider while other parts are still kept on bare metal.

Continue reading “Running multiple instances on the same hardware”

Percona Live Europe 2015

Well, it was ended a week ago, but I had too many errands to run so I couldn’t post anything about it.

It was really great, again.This was the third time I attended (2013 London, 2015 Santa Clara) so now I have met with a lot of familiar people – it is true that MySQL has a great community. The chosen city was great, Amsterdam is one of the coolest places in Europe, the hotel was neat, and the programs were also astounding.

The conference sessions were great too, I really enjoyed, them all, and because they are running on 8 thread parallel it is not that bad that there are some recurring sessions; if you missed one in spring you can watch it on autumn.

So, everything was comfy and neat. I hope I’ll attend on the next one too …

There were a few topics where I plan to dig deeper in the next weeks

  • ProxySQL because HAProxy is a good choice, but it only speaks TCP and HTTP but not MYSQL
  • Semi-Sync replication, because getting rid of replication lag would be useful
  • XtraDB Cluster/Galera cluster, because it seems a good evolutionary step beyond our current setup
  • DB options in the cloud.