Forum Moderators: phranque
Website performance issues
Is there a way to cache a whole page?
Have you tried a reverse proxy? mod_cache has done miracles for me.
Create a very basic HTML page. No PHP, no ads, just a static HTML file. Put some images and javascript in if you like but nothing that contacts an external site (i.e. feeds, ads).
You can rule out Joomla by creating a copy of a slow page as a static HTML file and testing it on it's own. In other words the page would have the same HTML/Javascript/CSS/Images that your CMS is outputting, but you would be serving it as an HTML file instead of through PHP.
Run some ping tests from multiple locations and see what kind of latency there is. If you can determine that there is dramatically higher latency from certain locations then that would point to a network issue at the NOC or one of their providers.
Looking at the point of "first load takes a lot of time", I am wondering if the DNS system is resolving your domain quickly enough. What nameserver are you using?
Is there a way to cache a whole page?
I must have skimmed right over that, good call. Another possibility would be that something on the page or in the scripts is contacting a slow external site, but only once for each visitor.
Debug PHP. I HIGHLY recommend Xdebug used in conjunction with WinCacheGrind.
1) Create a static 50K html page, no images. How long does that take to load.
2) Create a PHP page which calls a few dozen PHP functions loops a few times and spits out about 50K worth of data. How long does that take?
1) Your drives: Are you getting reasonable read and write speeds?
2) Your web server: Does it have enough processes to serve your busy site? Could your requests be queued?
3) Your PHP stack: Are you running a binary cache like xcache? Are you able to log slow running php queries ( if you're on a php-fpm install you can .. ) - this is without doubt one of the best points to start your code review.
4) Your joomla install. Does a barebones out of the package Joomla install on the same server give you better response times? Have you disabled modules and components and gotten a better or worse response? Some modules are horribly coded and result in lots of lags.
5) Your mysql stack: Have you got slow query logs turned on? Does your mysql have query caching turned on? Enough memory for various indexes etc? In general, I prefer to run mysql out of memory ( i.e. enough system ram for as much of the data as possible... )
Don't start hating your CMS until you've proven that it is really the problem.
On the Joomla end, you should turn on its xcache or memcache caches if you do have the ability to.
I think you are running in a VM Ware session on a Virtual Dedicated Server. So you are sharing disk and cpu resources with other virtual instances on the same computer.
Consider installing a network monitoring tool such as Munin...
You are committed to the current design so the biggest quickest bang for the buck is to look at indexes vs queries...
Debug PHP. I HIGHLY recommend Xdebug used in conjunction with WinCacheGrind.
As I know close to nothing about (l)unix, I doubt I can get this to work.
I would also like to mention that you should put any analytics code at the bottom of the page.
Insert the asynchronous snippet at the bottom of the <head> section of your pages, after any other scripts your page or template might use. One of the main advantages of the asynchronous snippet is that you can position it at the top of the HTML document. This increases the likelihood that the tracking beacon will be sent before the user leaves the page. We've determined that on most pages, the optimal location for the asynchronous snippet is at the bottom of the <head> section, just before the closing </head> tag.
Everyone seems to be ignoring the 1 second request time.