D
D
Diversia2019-07-25 08:33:05
1C-Bitrix
Diversia, 2019-07-25 08:33:05

Why did the database performance decrease when moving the site to 2 servers?

Hello!
The site has about 300,000 views per day (55,000 users per day), online at the peak of 900+ users. The site is hosted on a VPS (details below), up to 800+ coped perfectly, there was no change in functionality. VPS began to fail to cope with attendance (this is understandable). They advised to take a separate VPS for the database, leave the rest on the old one. But when moving the database to an additional server, the performance measurement in terms of the DB Performance Panel became worse:
Before:
MySQL database (write) 6,822
MySQL database (read) 15,262
MySQL database (change) 2,503
Now:
MySQL database ( write) 1549
MySQL database (read) 1602
MySQL database (change) 1582
$DBHost = was specified in the settings (and in host .settings.php). The VPS was configured with mariaBD 10 version with settings from the Bitrix ENV database of the latest version.
-Old VPS -
Centos7 OS
1.5 GB Memory
2x1 GHz Processor
20 GB SSD
Bitrix Env ​​last version
- New VPS under DB -
Centos7 OS (KVM)
2 GB Memory
2 cores 2.2 Hz
40 GB SSD
MariaDB 10
Servers in one DC.
Please advise what to do.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-07-25
@shambler81

1. naturally slowed down, even accessing through the local domain and localhost there is a difference, since the DNS server and ETH0 are involved, and the
server located, as I understand it, is not in the same data center, and even not physically connected with a cord, give a drawdown.
2. Show mysql
configs 2. you need to look at the server configs, you can tweak them a little, of course, but there are very simple means.
For example, switch to new I9 processors, and xeons are their counterparts.
Here is an example on Bitrix vm

База данных MySQL (запись)	12 694	5 600	количество запросов на запись в секунду
База данных MySQL (чтение)	81 827	7 800	количество запросов на чтение в секунду
База данных MySQL (изменение)	23 374	5 800	количество запросов на изменение в секунду

I think the comment is redundant.
3. what can be done to
replace innodb_flush_log_at_trx_commit = 2 with innodb_flush_log_at_trx_commit = 0
to optimize the number of connections, etc., but this is already necessary to analyze the site.
you also need to work with the cache on the site itself.
optimize images, enable css js merged cache and so on.
Be sure to raise php to the maximum version, ideally 7.3 yes vm by default pulls 7.1
In general, there is a whole layer of work that can be done.
But in your case, you have a slow VPS and the most reasonable thing is to change it.
this will break your server every 15
https://ru.hetzner.com/hosting/produkte_rootserver...
12 cores at 5 GHz
https://ru.hetzner.com/hosting/produkte_rootserver...
also more than enough 8 cores at a
price of -20% VAT since they are not available in Germany.
In Russia, processors are only 2 generations weaker, and for mysql, the speed of work per core is important and not their number, so if you take a 128 core with 3 ghz, then you will get a machine comparable to a bad office car (sorry 128) bad office cars.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question