dongshi3361 2012-05-29 21:53
浏览 44

迁移到新服务器,性能降低

I just moved my website to another server with upgraded specifications but I got stuck with the slow performance.

it was working great on old server but somehow on new server, when I do php user login, server responding me in 5 minutes! yeah, php executation takes 5 minutes long. Without logging in (using php sessions) it's working as expected. I'm using php+mysqli.

here is the comparision of two servers:

Old

  • Apache Version: Apache/2.2.15 (CentOS)
  • PHP Version: 5.4.0
  • MySQL version: mysqlnd 5.0.10 - 20111026 - $Revision: 323634 $

New

  • Apache Version: Apache/2
  • PHP Version: 5.4.3
  • Database client version: libmysql - 5.1.62

What should I do? I can't really figure out what's going on..

thank you.

  • 写回答

1条回答 默认 最新

  • donglengli0644 2015-08-17 19:51
    关注

    First, try actually measuring calls as others have already said to narrow down the issue.

    For instance the part where you connect to the database engine.

    Could it be that the MySQL server is running on a different machine?

    If so, there could be a reverse DNS problem where the MySQL server has trouble finding out about the name of the calling client.

    Or you could face an issue where the MySQL client tries an IPv6 connection twice before it finally decides to fall back to a trusty IPv4 address. This process will easily take 1 second or more!

    Try to connect to a normal IPv4 address instead of using a dynamic host name temporary and see if it instantly becomes faster.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度