关于如何调整 Web 应用程序的性能有什么好主意吗? [英] Is there any good idea about how to tuning the web application's performance?

查看:49
本文介绍了关于如何调整 Web 应用程序的性能有什么好主意吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨~我们正在做一个小项目,我们希望它在网上公开.现在我们的项目在本地运行的很好,但是当我们把它放在网上时,响应速度非常慢.我们都是网络开发领域的新手,所以请提供一些提示或建议.谢谢.

Hi~ we are working on a small project which we want it to be public on line. Now our project runs well in the local, However when we just hoop it on line, the respond speed is so slow. we are all new to web development area, so Please provide some tips or suggestions .Thank you.

我们使用php,mysql作为数据库,nginx作为服务器.

We use php, mysql as database and nginx as server.

欢迎提供任何建议.再次感谢你.

Any advice is more than welcome. Thank you again.

推荐答案

一些提示:

代码分析

使用 xdebug 的分析选项.这将使您深入了解可能需要优化的代码区域.

Use xdebug's profiling option. This will give you insight into areas of your code that may need optimization.

SQL 分析

我的大多数项目都使用 PostgreSQL,所以我自己并没有真正使用过它,但这里有一些关于 分析您的 MySQL 查询.同样,它会让您深入了解可以使用一些优化的 SQL 脚本区域.

Most of my projects use PostgreSQL, so I haven't actually used this myself, but here's some documentation on profiling your MySQL queries. Again, it'll give you insight into areas of your SQL scripts that could use some optimization.

调查缓存选项

如果您的页面上有很多数据库查询或页面中有很多 PHP 逻辑,那么生成这些查询可能会很昂贵.有几种不同的缓存方法,虽然每种方法都有助于解决加载时间问题,但每种方法都旨在解决不同的专门问题:

If you have a lot of database queries on your pages or a lot of PHP logic in your pages, it can be expensive to generate. There are a few different methods of cacheing and, while each method helps to solve load times, each aims to solve different specialized problems:

  • File based cache (article that explains the concept fairly well)
  • APC cache
  • Memcached
  • MySQL query cache

这些将是我优化项目的第一步.

These would be the first steps that I'd take in optimizing one of my projects.

TVK 的建议也有助于解决客户端性能问题.

TVK's suggestion is also good for nailing down client side performance issues.

这篇关于关于如何调整 Web 应用程序的性能有什么好主意吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆