Hey.

There is a need to bring MySQL to DEDIC / VPS, it is logical that the performance of the database will increase (we will assume that DEDIC / VPS have quite large computing resources). But what about delays in data transfer? If we consider that DEDIC / VPS with MySQL can be located at another hosting provider (maybe even located in another country). Leaving Mysql on localhost is not possible. How strong will the transmission delay be? And maybe there is some other, more correct, option?

Tell me please.

    2 answers 2

    Hello.

    Only you yourself can give an exhaustive answer to your question. Firstly, it is necessary to determine the reason why the need for database transfer arose. Based on your question, I can assume that at the moment the database is located on the server hosting the provider. Hosting providers, as a rule, allocate sufficiently powerful physical servers for the database servers; the actual configuration of the mysql daemon itself is performed by a specialist who is well aware of what he is doing. If the base has become the bottleneck in your application (you need to be 100% sure that this is the base, and not, for example, the disk subsystem), to check the speed of the database, perform a query speed diagnostics, query analysis and structure DB. In conducting diagnostic activities, you may benefit from built-in debugging tools for your application (debug mode) and utilities such as mytop . First of all, pay attention to the indexes and locks used by the storage engine. If from the point of view of the application there is no possibility of optimization, only in such a situation it is worth considering the option of transferring the database. Of course, when placing the database in another data center there will be costs associated with the network subsystem. The justification for such costs can be assessed using diagnostic tools, such as the set of tools supplied with mysql . Also, if you manage to administer the database server yourself, study the relevant literature. Otherwise, even on a powerful dedicated server, database performance can be worse than a hosting provider on a server. For the study may be useful official documentation and books. Among the Russian-language publications (including translations), in my opinion, the best is MySQL. Performance Optimization. Also in optimizing the settings directly for the mysql daemon, the mysqltuner script may be useful for the operation of your database. It is strongly recommended not to use it without a clear understanding of the actions you perform.

    • Thank you for the comprehensive answer. - Sever

    Now there are many DCs in the CIS. When choosing a DC located near you, the delay may not exceed 2-3 ms. You can always find out from the hosters where they are located, and also ask for IP addresses to check the remoteness of the server from you, and you can immediately see the delay in the network response. For example, the delay from the Netherlands or Germany is ~ 50 ms, the USA - 130 (this is from eastern Ukraine).