I installed an open source PHP project on my Ubuntu server and got it running. However, pages load extremely slow. A phpinfo() page and a basic test page connecting to the mysql db all load very fast. There are tons of include files, log files and some curl calls in this open source code. What strategies/tools can I use to track down the source of the slowness?
Enable OPcache on PHP server Thanks to OPcache which will cache the pre-compiled code and does not let it compile on later requests. Conducting the PHP performance test after integrating Opcache, some experts claim that PHP performance will be 3x faster and the load time will reduce much impressively.
PHP Code Performance Profiling A profiler is a tool that measures how some code consumes resources at run-time. It enables to find performance bottlenecks and understand the code's behavior. Blackfire Profiler for PHP enables to profile applications during development, test, staging, and production environments.
You need to profile pages, that have performance problems. It can be done with php-extension xdebug and kcachegrind.
Follow this steps:
sudo apt-get install php5-xdebug
.sudo apt-get install kcachegrind
.GET
parameter XDEBUG_PROFILE=1
. See related question.Some notes:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With