How to troubleshoot the cause of PHP PHP Web site is running slowly

How to troubleshoot the cause of PHP PHP Web site is running slowly
interpret global issues in their daily work often faced interview to always ask.

答:

网站运行速度慢,先判断是前端问题还是后端问题,直接通过开发人员工具(Chrome)或Firefox的Firebug查看请求慢的是资源开始接口。90%网站性能问题是由前端造成的。
常见前端问题解决思路
    前端js css flash资源慢 查看资源十分过大,对js css 进行压缩;删除赘余的包;引入框架时十分选用用于生产的mini包;图片等资源较多是是否试用cdn且cdn是否正常;页面缓存规则设置是否正确。。。。。
    前端问题综合查看,可以先看看YSlow的给出的提示。
后端常见问题,数据库执行时间过长、逻辑问题
后端接口逻辑问题查找方式
    PHP调试扩展Xdebug的profile日志能记录函数的执行耗时和调用关系等信息.
    PHP:使用xdebug profiler 做性能分析 - Google Chrome
    PHP-FPM也提供了slowlog慢日志.
    sql 执行时间太长问题查找和解决
    MySQL提供了slow_query_log慢查询日志.

Comprehensive look for the problem, choose a convenient graphical performance tools, you can find a very straightforward question
such as:
XHProf
XDebug

Guess you like

Origin www.cnblogs.com/djwhome/p/12562785.html