0

I have been working on the migration of a legacy ecommerce web application to a new server with far hardened security.

I have found an aspect with the MySQL server that I am not acquainted with and I am looking for some guidance here.

The admin side of the ecommerce app has its online instance and a local instance as well.

The local instance, running over an intranet, connects to the MySQL server of the online instance through a replication mechanism.

Here is some information on the replication aspect:

Server version: 5.6.33-0ubuntu0.14.04.1-log (Ubuntu)

mysql> SHOW SLAVE HOSTS;
+-----------+------+------+-----------+--------------------------------------+
| Server_id | Host | Port | Master_id | Slave_UUID                           |
+-----------+------+------+-----------+--------------------------------------+
|         1 |      | 3306 |         2 | 6a3c1b11-cda3-11e4-8520-b083fede55b6 |
+-----------+------+------+-----------+--------------------------------------+

mysql> SHOW FULL PROCESSLIST;
+-----------+-------------+-------------------+------+------------------+----------+-----------------------------------------------------------------------------+-----------------------+
| Id        | User        | Host              | db   | Command          | Time     | State                                                                       | Info                  |
+-----------+-------------+-------------------+------+------------------+----------+-----------------------------------------------------------------------------+-----------------------+
|         1 | system user |                   | NULL | Connect          | 43976299 | Waiting for master to send event                                            | NULL                  |
|         2 | system user |                   | NULL | Connect          |        6 | Slave has read all relay log; waiting for the slave I/O thread to update it | NULL                  |
| 105155584 | username    | ***.***.*.*:***** | NULL | Binlog Dump GTID |   497652 | Master has sent all binlog to slave; waiting for binlog to be updated       | NULL                  |
| 106031746 | root        | localhost         | NULL | Query            |        0 | init                                                                        | SHOW FULL PROCESSLIST |
+-----------+-------------+-------------------+------+------------------+----------+-----------------------------------------------------------------------------+-----------------------+

Will it work the same if the local instance connects to the master instead of the slave?

The MySQL server does not have any kind of performance issue, the load avg never goes above 2.0 for a 12 core cpu.

  • Since a single connection won't use more than one core, a load avg of 1.0 might be a red flag. – Rick James Aug 23 at 17:26
  • "Will it work the same" -- Performance-wise, it depends on network latency. The results should be the same. Be aware that you must not write to a Slave. – Rick James Aug 23 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.