Our WordPress theme working so slow on Apache, Debian Server.
(This can be occurs from File Permissions and/or WordPress and/or MariaDB)
We are trying to find the problem via Xdebug
The problem is according to the Xdebug everything is all right. :)
However it is not.
When we simply check process runtime as follow it took 3.062 mseconds.
$then = microtime();
myFunc();
$now = microtime();
echo sprintf("Elapsed: %f", $now-$then);
However Xdebug shows it only took 482 mseconds.
Why this difference occurs ? What causes this?
We tried Debug Bar plugin etc. Nothing helped us.
What is best way to find What is Slowing Down?
We are using WordPress with Xdebug on following environment
- WordPress 5.6.2
- MySQL Distrib 10.3.27-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
- Debian GNU/Linux 10 (buster)
- ISPConfig 3
- Apache/2.4.38 (Debian)
- PHP 7.3.27-1~deb10u1
- Zend Engine v3.3.27
- with Zend OPcache v7.3.27-1~deb10u1
Our Xdebug config as follow:
xdebug.remote_enable=1
xdebug.profiler_enable=1
xdebug.profiler_output_name = "cachegrind.out.%u-%H-%R.txt"
xdebug.var_display_max_depth=10
xdebug.output_dir = /tmp
xdebug.log=10
xdebug.mode=develop,trace
My Answer:
The difference in runtime reported by Xdebug and your manual timing could be due to various factors such as overhead from Xdebug itself, the way Xdebug collects and reports data, or the specific configuration settings you have enabled for Xdebug.
To find out what is slowing down your WordPress theme on Apache, Debian Server, you can try the following steps:
1. Disable Xdebug temporarily and see if there is any improvement in performance. This will help you determine if Xdebug itself is causing the slowdown.
2. Use profiling tools like XHProf or Blackfire to get more detailed insights into the performance of your WordPress theme. These tools can provide detailed reports on where the most time is being spent during the execution of your code.
3. Check your server configuration, including PHP settings, Apache settings, and MySQL settings. Make sure they are optimized for performance and are not causing any bottlenecks.
4. Review your WordPress theme code and plugins for any inefficient code or database queries that could be slowing down the performance. Consider optimizing or refactoring them for better performance.
5. Monitor server resources like CPU usage, memory usage, and disk I/O to identify any resource constraints that could be impacting the performance of your WordPress site.
By following these steps and analyzing the data from profiling tools, you should be able to pinpoint the exact cause of the slowdown and take appropriate actions to improve the performance of your WordPress theme on Apache, Debian Server.
Rate this post
3 of 5 based on 1470 votesComments