大网数据广告活动
服务器运维问答

Website responds very slow using remote database

· 52CE 我爱测

I want two same websites to share one database. One server is in Asia, hosting a website and the database. Another server is in the US, hosting the same web via remote database. However, the web in the US responds very slow but w…

问题原文

原帖链接 · LeoZ · CC BY-SA 4.0

I want two same websites to share one database. One server is in Asia, hosting a website and the database. Another server is in the US, hosting the same web via remote database. However, the web in the US responds very slow but when moving the database to the local server(US server), the web responds fast. How to speed up the connection between the server in the US and the database in Asia?

I am using Centos7+Nginx+MySQL.

社区高分解答

原帖链接 · vidarlo · CC BY-SA 4.0

How to speed up the connection between the server in the US and the database in Asia?

You probably can't. US-Asia is a long distance, and there's latency involved. Simply put: the light has a finite speed.

You should probably look into alternatives to querying a remote database, such as caching assets in multiple locations, using a CDN, or using a database replication scheme so that you can have local copies of the data.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-12-31)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。