MySQL Tech-Feed (en)

Avoid temporary disk tables with MySQL

Shinguz - Fri, 2014-12-19 07:38

For processing SELECT queries MySQL needs some times the help of temporary tables. These temporary tables can be created either in memory or on disk.

The number of creations of such temporary tables can be found with the following command:

mysql> SHOW GLOBAL STATUS LIKE 'created_tmp%tables';
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 4     |
| Created_tmp_tables      | 36    |
+-------------------------+-------+ …

Taxonomy upgrade extras:  Temporary Table  Disk  Select  Query Tuning 

Making HAProxy High Available for MySQL Galera Cluster

Shinguz - Sun, 2014-12-14 18:37

After properly installing and testing a Galera Cluster we see that the set-up is not finished yet. It needs something in front of the Galera Cluster that balances the load over all nodes.
So we install a load balancer in front of the Galera Cluster. Typically nowadays HAProxy is chosen for this purpose. But then we find, that the whole Galera Cluster is still not high available in case the load balancer fails or dies. So we need a second load balancer for high availability.
But how should we properly …


Taxonomy upgrade extras:  Haproxy  Load Balancer  Galera Cluster  Vip  Virtual Ip  High Availability  Ha  Keepalived 

failed MySQL DDL commands and Galera replication

Shinguz - Tue, 2014-12-09 15:45

We have recently seen a case where the following command was executed on a Galera Cluster node:

SQL> GRANT SUPER ON userdb.* TO root@127.0.0.111;
ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES

2014-12-09 14:53:55 7457 [Warning] Did not write failed 'GRANT SUPER ON userdb.* TO root@127.0.0.111' into binary log while granting/revoking privileges in databases.
2014-12-09 14:53:55 7457 [ERROR] Slave SQL: Error 'Incorrect usage of DB GRANT and GLOBAL PRIVILEGES' on query. Default …

Taxonomy upgrade extras:  Galera  Replication  Ddl  Toi  Rsu 

Get rid of wrongly deleted InnoDB tables

Shinguz - Wed, 2014-10-22 22:10

Precaution: Before you try this out on your production system do a BACKUP first! FromDual Backup Manager can help you with this.

Situation

A MySQL user has delete its InnoDB table files for example like this:

shell> rm -f $datadir/test/test.*

Analysis

We do some analysis first:

mysql> DROP TABLE test;
ERROR 1051 (42S02): Unknown table 'test'

mysql> CREATE TABLE test (id INT) ENGINE = InnoDB;
ERROR 1050 (42S01): Table '`test`.`test`' already exists

The MySQL error log shows us the following …


Taxonomy upgrade extras:  Backup  Restore  Recovery  Innodb  Table 

Migration between MySQL/Percona Server and MariaDB

Shinguz - Wed, 2014-10-08 21:40

This week, we did some migrations from MariaDB 10.0 to Percona Server 5.6 at the IT department of a big German bank.

We were perfectly aware that since version 10.0 the MariaDB code base started to diverge slightly away from the MySQL and Percona Server code base which are still pretty close to each other.

Because of the Percona Server option enforce_storage_engine we wanted to do this migration.

We stopped the MariaDB 10.0 server, replaced the binaries by the Percona Server 5.6 binaries, and started the …


Taxonomy upgrade extras:  Migration  Sidegrade  Upgrade  Mysql  Mariadb  Percona Server  Conversion  Compatibility  10.0  5.6 

Replication channel failover with Galera Cluster for MySQL

Shinguz - Thu, 2014-06-19 07:05

Sometimes it could be desirable to replicate from a Galera Cluster to a single MySQL slave or to an other Galera Cluster. Reasons for this measure could be:

  • An unstable network between two Galera Cluster locations.
  • A separation of a reporting slave and the Galera Cluster so that heavy reports on the slave do not affect the Galera Cluster performance.
  • Mixing different sources in a slave or a Galera Cluster (fan-in replication).

This article is based on earlier research work (see MySQL Cluster - Cluster …


Taxonomy upgrade extras:  Channel  Galera  Cluster  Failover  Replication  Master  Slave 

FromDual Ops Center

Shinguz - Wed, 2014-01-01 12:43

The FromDual Ops Center for MariaDB and MySQL (focmm) is a browser-based Graphical User Interface (GUI) to operate and manage your MariaDB and MySQL database farms (2 - 99 instances) more easily.
If further provides tools to implement your own Database as a Service (DBaaS) infrastructure.



FromDual Ops Center covers the full life-cycle of a database:

  • Installation of your database from different Repositories.
  • Configuration of your database instance.
  • Track configuration changes of your database instance. …

Taxonomy upgrade extras:  Focmm  Ops Center  Operations  Administration 

MySQL and MariaDB support subscription

Shinguz - Mon, 2013-12-23 15:40

Will you be at a loss having a MySQL or MariaDB database problem? Will you need urgently help from experienced FromDual staff when your production MySQL or MariaDB database stops working? Or do you need a third party opinion for one of your MySQL or MariaDB solutions?

FromDual offers you vendor independent database support for MySQL (community and enterprise edition), MariaDB (community and enterprise edition) and Percona Server for all versions starting with 4.0.

How we provide support?

Our FromDual …


Taxonomy upgrade extras:  Mysql  Support  Subscription  Mariadb  Service 

What are the costs of one hour MySQL downtime?

Shinguz - Tue, 2013-12-17 14:59

Hello,

there are companies which earn tens of thousands of Euros per hour with their MySQL databases. Other companies operate their ERP system on MySQL, to which 1000 employees are attached to. Is the database down 1000 people are not working any more until the system is working again! Downtime costs starting at EUR 30'000.- per hour upwards.

Support through the MySQL specialists?

These companies have properly planned operations of their MySQL databases, designed their production systems redundantly and …


Taxonomy upgrade extras:  Mysql  Support  Myenv  Galera 

Love is all around...

Shinguz - Mon, 2013-12-16 09:15

Thanks, Morgan!


Taxonomy upgrade extras: 

MySQL single query performance - the truth!

Shinguz - Fri, 2013-12-13 17:33

MySQL single query performance - the truth!

As suggested by morgo I did a little test for the same query and the same data-set mentioned in Impact of column types on MySQL JOIN performance but looking into an other dimension: the time (aka MySQL versions).

The answer

To make it short. As a good consultant the answer must be: “It depends!” :-)

The test

The query was again the following:

SELECT *
  FROM a
  JOIN b ON b.a_id = a.id
 WHERE a.id BETWEEN 10000 AND 15000
;

The Query Execution Plan was …


Taxonomy upgrade extras:  Mysql  Performance  Performance Tuning  Query  Query Tuning  Tuning  Sidegrade 

MySQL slower over time?

Shinguz - Thu, 2013-12-12 08:25

Hi Morgan,

Thanks!

I have planed such a test already a while ago but did not find the time to do it yet...

In my mind I have some numbers showing that since MySQL 4.0 single query performance has decreased significantly...

This leads to the question: Where are all the MySQL branches and forks heading to and is this in the interest of the majority of the MySQL users or just in the interest of a few ones like Facebook, LinkeId, Google, Booking.com etc...?

Regards,
Oli


Taxonomy upgrade extras: 

Impact of column types on MySQL JOIN performance

Shinguz - Wed, 2013-12-11 20:12

In our MySQL trainings and consulting engagements we tell our customers always to use the smallest possible data type to get better query performance. Especially for the JOIN columns. This advice is supported as well by the MySQL documentation in the chapter Optimizing Data Types:

Use the most efficient (smallest) data types possible. MySQL has many specialized types that save disk space and memory. For example, use the smaller integer types if possible to get smaller tables. MEDIUMINT is often a better …


Taxonomy upgrade extras:  Sql  Query  Tuning  Mysql 

MySQL/MariaDB development support

Shinguz - Wed, 2013-12-11 12:42

If you are not operating MySQL databases yourself, but you develop MySQL based software, our MySQL development support is exactly fitting to your needs!

Are your developers hitting technical MySQL problems from time to time or have they a technical MySQL question, our support team is pleased to answer your questions after having talked to the FromDual consulting team.

This support contract is ticket- and not server-based and thus ideally fitting to your software development team. Any number of your MySQL …


Taxonomy upgrade extras:  Support  Mysql Support 

Galera Cluster for MySQL

Shinguz - Wed, 2013-12-11 12:08

Features

Galera is a synchronous multi-master replication Cluster for MySQL/InnoDB databases, having features like:

  • Synchronous replication
  • Active-active multi-master topology
  • Read and write to any cluster node
  • Automatic membership control, failed nodes drop from the cluster
  • Automatic node joining
  • True parallel replication, on row level
  • Direct client connections, native MySQL look & feel

Benefits

The benefits of these features are:

  • No slave lag
  • No lost transactions
  • Read scalability and write …

Taxonomy upgrade extras:  Galera  Cluster  Mysql Cluster  Replication 

Shrink InnoDB (System-)Tablespace

Shinguz - Sat, 2013-11-30 11:41

Hello csmanioto,

As mentioned above this is a PoC and should never be used on system with critical data because it is an evil hack!!!

If you would like to see this comming in production soon you should vote fore this feature request.


Taxonomy upgrade extras: 

Galera Cluster 3.1 GA is out!

Shinguz - Wed, 2013-11-13 11:14

Great News: Galera Cluster v3.1 GA for MySQL 5.6 was released at Percona Live London (PLUK) 2013. The information is still a bit hidden…

You can find it here:

Or directly on our download page.

Careful: Online-Upgrade from 5.5 to 5.6 will not work yet. We have to find a work-around…


Taxonomy upgrade extras: 

Murphy’s Law is also valid for Galera Cluster for MySQL

Shinguz - Fri, 2013-10-04 20:10

We had a Galera Cluster support case recently. The customer was drenched in tears because his Galera Cluster did not work any more and he could not make it work any more.

Upsss! What has happened?

A bit of the background of this case: The customer wanted to do a rolling-restart of the Galera Cluster under load because of an Operating System upgrade which requires a reboot of the system.

Lets have a look at the MySQL error log to see what was going on. Customer restarted server with NodeC:

12:20:42 NodeC: …

Taxonomy upgrade extras: 

#ports and FIN_TIMEOUT

Shinguz - Mon, 2013-09-23 21:07

Hello thatsafunnynamecomment,

Thanks for reading and correcting my findings! You are absolutely right. I did a bit short-cut too much in maths!

For your comment #2 it looks like I did not investigate carefully enough. Thanks for correcting me. I found several sources pointing to tcp_fin_timeout and mentioned TIME_WAIT is affected. So I should just be more careful next time. Especially in a domain I am an absolute noob.

Shinguz


Taxonomy upgrade extras: 

Huge amount of TIME_WAIT connections

Shinguz - Sat, 2013-09-21 11:11

In MySQL we have the typical behaviour that we open and close connections very often and rapidly. So we have very short-living connections to the server. This can lead in extreme cases to the situation that the maximum number of TCP ports are exhausted.

The maximum number of TCP ports we can find with:

# cat /proc/sys/net/ipv4/ip_local_port_range
32768   61000

In this example we can have in maximum (61000 - 32768 = 28232) connections concurrently open.

When a TCP connections closes the port cannot be …


Taxonomy upgrade extras: 

Pages

Subscribe to FromDual aggregator - MySQL Tech-Feed (en)