Joomla site extremely slow

This is a new installation of Joomla 1.6 with the database from a previous 1.5 installation that was hacked, so it all had to be cleaned.

I wasn’t involved with the new installation but am now taking over and the site is loading incredibly slowly 15-20 seconds
http://www.webpagetest.org/result/111109_T6_24EVM/1/details/

There seems to be a long delay at the start for the ‘time to first byte’, I’m not sure what is loading there, hope someone here can help me understand the info and fix the problem!!

During the new installation, the site was put on another domain and then moved - I’m wondering if instead of moving it, it was redirected and that is slowing it down?

Rob

The first byte time is kind of a black box from the outside so we can’t provide a lot of direct visibility. I can say that it’s not a redirect though. 90% of the time the first byte performance issues in joomla or wordpress are because of database queries (a lot of them and sometimes slow). The other 10% usually come from back-end requests to external services.

You can start by looking at your database slow query log to see if there are any common slow queries that can be helped by adding a database index. Beyond that it usually requires instrumenting the server code or experimentation with turning things on and off to see where the issue is.

If you have access to modify the php install then tools like New Relic or Dynatrace can be really helpful by telling you exactly where the slow code or queries are (I know New Relic has a free trial period, not sure about Dynatrace).

Thanks very much pmeenan, so I can rule out some strange redirection process, that’s good. I will start looking at the Joomla installation, as you suggest

Rob

Re The delay before anything happens - I noticed today that I type in HTTP://sitename etc and nothing happens, then the URL changes to Http://www.sitename etc and immediately the page begins loading- I don’t know why the page is showing the www ?

Rob

That is going to be completely unrelated. You must be using chrome with instant turned on or something like that where it predicts what you are typing and loads the page.

Thanks pmeenan - No I’m using FFox and typing into the address bar - there is a 10 second wait and the instant the address changes to http://www the site begins loading.

The .htaccess file has this as the last two entries

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ “http://www.aussiebrewer.com.au/” [R=301,L]

Ahh, gotcha. What does it look like when you test without the www on webpagetest? It could be that your web server is running out of clients to handle the connections and the 10 seconds is the time for a new client to free up (a common problem if you are using apache with mod_php and keep-alives enabled).

It could also be that the browser doesn’t update the address bar until the html starts coming in.

Hi again- I have performed the webpage test with and without the www

With WWW

Without www

With www time to first byte went down to 6.8 seconds but the repeat test was slower

without WWW, which is the way I’ve been testing, showed 20.2 seconds!! but the repeat test was faster

Yes it could be the browser that is not updating the url until it receives the first byte. I don’t know enough about this stuff to know what to do next.

UPDATE:Not sure if this could be part of the problem - the website SHOULD be .com.au -in control panel the website is shown as .biz and under redirects it is being redirected to htttp://WWWdomainname.com.au

Seems to me this is a complicated way to arrive at the correct website?

Please can you give me any more advice? and if not, please could you give me any links where I can learn about this?

I didn’t realise that serving up a web page had so many stages - I’ve never had a website load so slowly before and usually it’s the image size and number that are the components that cause any delay.

I’ve never heard of ‘keep alive’ before, didn’t know there was a “database slow query log” and never before encountered "the first byte performance issues in joomla or wordpress are because of database queries " although I usually work with Wordpress not Joomla

Thanks

Rob

Your hosting provider might be able to help with some of the back-end and server issues (keep-alives, database performance, web server scaling). It sounds like you’re on a shared hosting plan where they take care of most of the nuts and bolts of serving so a lot of it is going to be outside of your control.

Do you use the same host for other sites that do perform well ot is this also your first experience with them? The reason I ask is that it’s entirely possible that they have you on a server that is WAY over-subscribed and may never perform well. Things like HTTP keep-alives are entirely within their control and the fact that they have them disabled is an indicator that they may be running their server exceptionally hot.

If you want to research it yourself you’ll probably want to spend a lot of time on Google looking for things like “performance tuning mysql”, “debugging mysql query performance”, “performance tuning apache” and things like that but if you’re not comfortable with linux and system administration it will be a pretty steep learning curve.

Thanks very much for your advice Patrick. I didn’t set this site up so it is not a site in my reseller account with Jiffynet- I wish it was, because those guys are so helpful. I’ve been with Jiffynet for a few years and have had no problems with them and much help.

I have never had to delve into the server side operations, as you say, looks like a steep learning curve ahead!

BTW the keep alives are enabled, the site scored an A for keep alives http://www.webpagetest.org/result/111109…1/details/

I will contact support at the server and also use the google phrases you provided- knowing the right question and jargon saves me a lot of time so thanks.

I have googled for how to run a ‘database slow query log’ and so far the results all start from a point past the beginning! I need to know how to get started on that.

On the Documentation page there are some consultants, if I don’t have any success would it be worth contacting one of them? and what hourly rate should I expect?

Thanks again

Rob

If you get stuck it wouldn’t hurt to reach out to one of them though I’m not sure what the rates are usually. If it is a hosting problem their hands may be tied (other than to conclusively tell you that it is a hosting problem).

Thanks,

-Pat

Someone else has managed to discover " there’s a process on the server that’s using up all available RAM & a lot of the CPU. This shouldn’t be difficult to fix, but to do so I need full access to the server " he says “if you can request SSH access from the host the fix should be pretty quick”
At this stage I don’t know how he discovered this, but sounds like he’s found the problem. I also don’t know why SSH access will enable a fix- I’m out of my depth on this one! I thought SSH was just a secure connection to avoid eavesdropping.

SSH is a login to the server that they can use to terminate processes. I’d be curious about how they figured it out without access to the server though. Just make sure it is someone you trust because they will have full access to everything on the server (if it is an account with root access).

You’re probably confusing it with SSL which is the encryption used for HTTPS (and SSH).

Thanks,

-Pat

It definitely looks like a server configuration problem to me. If your redirect from non-www to www is done via mod-rewrite rule, then it should be near instant. Looking at the http headers as they come in, there is about a 6 second wait for me to even receive a redirect header response, and then the same delay occurs when it attempts to load the www part as well. How much traffic is this site receiving (if at liberty to say) and what type of hosting is it on?

Keep alive keeps the initial tcp connection you create to the server open. This makes it so that a request for every single asset doesn’t need to recreate the connection. It’s quite a good thing, but if your server has a lower cap on the number of connections than the amount of connections needed, the connections may be refused or queued. And yes, since dynamic sites are pieced together from information in databases, database and individual query performance can have a major effect on the speed of the page delivery. That is usually something you want to be conscious of when developing a site. And since plugins in such sites can add their own database queries, the more plugins you have the more queries you have (even if they pull the same data), and the higher chance you have of a query being inefficient. It’s not a problem particular to Joomla, more so any dynamic site. I’ve seen Wordpress site’s that have a hideous time to first byte as well. If you don’t need to keep things so cookie cutter based you can always go through the template and plugin code and simplify, make static, and/or remove features you don’t need. Though I’d only recommend that if you’re an experienced programmer otherwise it’s easy to make a mess of things.[hr]

Yes, I too wonder how he found this out without access to the server via SSH. And yes, make sure you trust this individual. At the very least, it’s quite easy to mess up a server config, at the very worst, they can install stuff on the server that can capture payment information.

Thanks for the info Jarrod1937 - the other person trying to fix this was the original developer so he is trusted by the company, there are no worries there.
I noticed that CPanel was as slow as the frontend and he noticed it too.
I asked him how he discovered what the problem was and he said he rang hostdime -“they confirmed 1GB memory was maxed out & CPU was very stretched. A Joomla site shouldn’t use anywhere near that much memory unless it’s extremely busy, which means 90% chance a process is looping. As soon as we get in we can run a memory analyser called “top”, which will tell us what’s using all the CPU, and from there either disable the process or rewrite the offending line(s).”
We had to get authorised to use the help desk at hostdime! hopefully that’s done now.
The template has been created by Artisteer and I believe Artisteer has encountered some problems building joomla Templates, I would like to swap templates to check if it makes any difference- will I be able to swap back without breaking anything?
I’d also like to learn about SSH and what can be done with it- and how

Yeah, if he is trusted then it should be fine. I don’t have enough experience with Joomla to know what will happen if you swap templates but it should be fine (usually it just impacts how the site looks and doesn’t materially impact the database).

SSH is basically the same thing as if you were sitting in front of the server logged into it. You can do just about everything you would be able to do (as long as your account has permissions to do it). A sudo (or root) account would let you do anything you wanted - install software, change the OS configuration, reboot, etc.

I’m still struggling with this problem, with sadly no solution. I am slowly clearing a tangle where the DNS pointed to JustHost who had redirect to USWDH - there the account was a .biz domain name and should be .com.au so on that account there was a redirect from .biz to .com.au

When I fixed that the TTFB showed only 3.6 second but this morning it was back to 10secs then later 3.6secs and then 12 seconds !!

The host, USWDH,tested by transferring the complete site to a known good server and there was no significant speed change. They have been extremely helpful.

I can see lots of delays after ttfb, the scripts need to be combined or shrunk, some large images etc - and I can handle that- but what the heck happens in the currently 9 second gap after dns lookup (1 second!!!) and initial connection? Here’s a recent speed test - http://www.webpagetest.org/result/111209_3J_2EYP9/1/details/

Surely there is a scanner or program that can tell me what is going on in that time? It must be a black art because even the host don’t know what is happening there.

Yes, there are profilers that will tell you what is going on but it does require installing a php module. If you have that level of access to the system then I HIGHLY recommend trying New Relic. It will tell you how much time is being spent in various areas of the app, including the database queries and will dump the actual queries that are performing slowly. It is free to install and for the first 14 days you get a free trial of their pro-level diagnostics.

When they moved your site over to a new server, did they also move the database? It’s not uncommon for the database to be on a different server and my money is on the database being the problem.