So I have five identical websites, running on five machines provisioned in the same way. The only thing that differs between these installations are the language files and the languages of the text stored in MySQL tables.
Four of them have no problems what so ever. One is struggling a LOT under the same or somewhat less load than the other four.
I cannot understand why this is.
Things I've done so far:
- Checked slow queries. All queries uses indexes and are in the realm of 0.0008 Sec execution time i.e. very fast
- I've noticed that the thing that causes most trouble for this MySQL instance is UPDATE and INSERT, so much so, I've turned off the UPDATE's that were there, for this instance. Bear in mind that these UPDATE's doesn't cause a blip on the other servers.
- Tried to eliminate external factors i.e. noisy neighbours (moved host) etc.
Worth noticing is that the machines are deployed the same i.e. a vanilla Debian 10 installation with a LEMP stack, nothing out of the ordinary at all.
Still, the problem persists. I can see the load of the machine struggling to keep under 1.00. The other machines are in the 0.10 - 0.20 range all the time.
Looking at CPU for the MySQL process on this machine (with 2 CPU cores as the other machines have as well) it is quite often above 100%. The other machines are never - EVER - over 60% for the MySQL process.
So, any help is much appreciated.
Please do let me know if you need me to run a command that you need to see the output from in order to help.
Thanks.
EDIT Spelling and clarifications
2 Answers 2
This sounds like a configuration issue. INSERT/UPDATE statements result in writes, so you should look at the write path. Check the following:
- Is write caching on the disks enabled?
- Are the disks configured the same way (RAID geometry, file system, mount options, controller)?
- Are your InnoDB transaction logs the same size and configuration (innodb_log_% options)?
- Are your disk flushing options configured the same (sync_%, innodb_flush_%)?
-
First, thanks for answering. 1: yes, 2: no idea, these are all VPS' and are provisioned the same way, 3+4: I have made zero changes to the my.cnf (or the .d-directories it's split up into these days, I'm just running it with all defaults) = yes, they are the same, they are set to whatever is default these days.Adergaard– Adergaard2020年09月12日 10:53:44 +00:00Commented Sep 12, 2020 at 10:53
-
2: So it could be one of the VMs being on a host with noisy neighbours. Have you explicitly compared the boot parameters (/proc/cmdline) and fstabs between the machines? 3,4: Have you actually downloaded them and diff-ed the configs? A lot of the time discrepancies get missed because the admin "knows" they must be the same.Gordan Bobić– Gordan Bobić2020年09月12日 11:04:15 +00:00Commented Sep 12, 2020 at 11:04
-
See item 3 in my list above. I've moved hosts twice. The host is not the problem.Adergaard– Adergaard2020年09月12日 11:34:01 +00:00Commented Sep 12, 2020 at 11:34
-
Other things to check: disk I/O scheduler, kernel tuning (tuned-adm), kernel version, network configuration.(offload, buffers).Gordan Bobić– Gordan Bobić2020年09月12日 13:10:51 +00:00Commented Sep 12, 2020 at 13:10
Things to consider:
Some underlying VM systems can provide resource preferences to one vserver vs another. (unlikely... but)
Also depending on what type of disk using, where and how the volume is carved you might have a volume on either a slower drive or a drive that is more active.
If you're using NAS - it could also be because of misconfigured vNIC or if you have a dedicated hard NIC it could be misconfigured or failing, maybe event failing switch port too in this case.
I hate these situations so just trying to think outside the box a bit for you.
SHOW GLOBAL VARIABLES
between the slow guy and one of the others. Provide the diff for us to advise on. Also check that all of your tables are using InnoDB, not MyISAM.