how to optimize joomla to become faster?

Discussion in 'Joomla' started by lebspy, Mar 19, 2011.

  1. #1
    hi all, is it possible optimize joomla to make it run fast and less cpu load?
     
    lebspy, Mar 19, 2011 IP
  2. Ace Lasher

    Ace Lasher Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I use Joomla for all of my sites. If you're running Joomla 1.5 there are some performance issues. Joomla 1.6 is much better. It uses the new MySQLi driver which should help performance.

    Here's what I did to speed up Joomla 1.5:

    1. If you don't have one, download a database tool like Navicat. There's a free version with reduced functionality that will work just fine. You can also use PHPMyAdmin and other server side database tools.
    2. Start adding indexes to your jos_content table and a few others.

    Step number two isn't hard to do, but there is a prerequisite step -- you need to determine how your data is being viewed i.e. how it is being retrieved. This means looking at the SQL queries.

    You'll probably see that there are a lot of LEFT JOINS. MySQL isn't capable of using multiple indexes for a single query. So, to combat that, you can create what are called "covered indexes" and multi-column indexes.

    A covered index basically contains all of the data needed to satisfy the query of a particular table. These are great because they're really fast. Don't go hog wild with them though. You don't want to create an index with every column of a table/ Usually three or four columns is the max.

    Multi-column indexes are like covered indexes, but the don't have all of the data necessary to solve an entire query. They do have enough to solve a JOIN without going back to the data store.

    BTW, that's the point of these indexes - minimize the number of calls and I/O to the data store. Indexes are often stored in memory (cache). Accessing indexes is much less time consuming than accessing data on disk. (Even with massive virtualization or putting an entire database into cache, there are still extra instructions (CPU cycles) that have to be used to get data from "disk" virtualized or not.)

    Here's another important thing to know - MySQL indexes are accessed from left to right.

    One of the indexes I created was for a query that is based on article modified date, published (state), section and category. So, I created an index that looked like this:

    "modified_date, state, sectionid, catid"

    This index sped the query up because the indexes were ordered by modified date and contained the state, category and section - which was enough to satisfy the LEFT JOIN without going to "disk".

    Now, if I were to make that index a clustered index, it may be even faster. A clustered index will store the data pages in next to each other so they can be retrieved using internal optimizing routines like PREFETCH. To do this, I'd need to drop all the out of the box indexes and build my index first and make sure it has only NOT NULL columns. MySQL creates a clustered index automatically. One day MySQL will let us define multiple clustered indexes like other databases.

    Anywa, sorry this is so fragmented. It should help.
     
    Ace Lasher, Mar 19, 2011 IP
  3. Ace Lasher

    Ace Lasher Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I use Joomla for all of my sites. If you're running Joomla 1.5 there are some performance issues. Joomla 1.6 is much better. It uses the new MySQLi driver which should help performance.

    Here's what I did to speed up Joomla 1.5:

    1. If you don't have one, download a database tool like Navicat. There's a free version with reduced functionality that will work just fine. You can also use PHPMyAdmin and other server side database tools.
    2. Start adding indexes to your jos_content table and a few others.

    Step number two isn't hard to do, but there is a prerequisite step -- you need to determine how your data is being viewed i.e. how it is being retrieved. This means looking at the SQL queries.

    You'll probably see that there are a lot of LEFT JOINS. MySQL isn't capable of using multiple indexes for a single query. So, to combat that, you can create what are called "covered indexes" and multi-column indexes.

    A covered index basically contains all of the data needed to satisfy the query of a particular table. These are great because they're really fast. Don't go hog wild with them though. You don't want to create an index with every column of a table/ Usually three or four columns is the max.

    Multi-column indexes are like covered indexes, but the don't have all of the data necessary to solve an entire query. They do have enough to solve a JOIN without going back to the data store.

    BTW, that's the point of these indexes - minimize the number of calls and I/O to the data store. Indexes are often stored in memory (cache). Accessing indexes is much less time consuming than accessing data on disk. (Even with massive virtualization or putting an entire database into cache, there are still extra instructions (CPU cycles) that have to be used to get data from "disk" virtualized or not.)

    Here's another important thing to know - MySQL indexes are accessed from left to right.

    One of the indexes I created was for a query that is based on article modified date, published (state), section and category. So, I created an index that looked like this:

    "modified_date, state, sectionid, catid"

    This index sped the query up because the indexes were ordered by modified date and contained the state, category and section - which was enough to satisfy the LEFT JOIN without going to "disk".

    Now, if I were to make that index a clustered index, it may be even faster. A clustered index will store the data pages in next to each other so they can be retrieved using internal optimizing routines like PREFETCH. To do this, I'd need to drop all the out of the box indexes and build my index first and make sure it has only NOT NULL columns. MySQL creates a clustered index automatically. One day MySQL will let us define multiple clustered indexes like other databases.

    Anywa, sorry this is so fragmented. It should help.
     
    Ace Lasher, Mar 19, 2011 IP
  4. Ace Lasher

    Ace Lasher Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Mods - this second post was inadvertent. It happened because I closed my laptop while in this thread then, when I reopened my laptop a few hours later the system asked me to log in again, so I did. The system then redirected me back to this thread and reposted my response. Feel free to delete it. Thanks.
     
    Ace Lasher, Mar 19, 2011 IP
  5. schlogo

    schlogo Well-Known Member

    Messages:
    1,615
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    140
    #5
    Well, sounds like you have a problem with an existing website. You should explain us what is the exact issue
     
    schlogo, Mar 21, 2011 IP
  6. glamourshades

    glamourshades Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I have found that the host makes a BIG difference in the speed of Joomla. Godaddy is sooo... slow. Hostgator is zippy.
     
    glamourshades, Mar 21, 2011 IP
  7. bobjones

    bobjones Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I also have the same problem on my Joomla site, I'm hosting with Godaddy. I'm not using a lot of plugins or anything so it must be the host. I have a fast connection.
     
    bobjones, Mar 22, 2011 IP
  8. lebspy

    lebspy Guest

    Messages:
    123
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    thanks alot guys for the info!! :)
     
    lebspy, Mar 25, 2011 IP
  9. BreadCrumbs

    BreadCrumbs Banned

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #9
    I host my Joomla site on iPage web hosting. They got unlimited web hosting feature so my site is very fast. I host my site before on a free web hosting with only 5G for the web space and it was so slow. I think one of the reasons your site loads slowly is because of limited web space.
     
    BreadCrumbs, Mar 25, 2011 IP
  10. coolmalliga

    coolmalliga Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    enable chaching facility.
    use plugin cssjscompressor.
     
    coolmalliga, Mar 27, 2011 IP
  11. Blue Star Ent.

    Blue Star Ent. Well-Known Member

    Messages:
    1,989
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    160
    #11
    At the very least enable caching. Here is a link with some good info from smashingmagazine : LINK
     
    Blue Star Ent., Mar 29, 2011 IP
  12. webrules

    webrules Peon

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Yes, These are the most basic tips and everyone should follow those rules.
     
    webrules, Apr 17, 2011 IP
  13. baliwebserver

    baliwebserver Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Woow this is good knowledge for us..thank you

    Bali Webserver
     
    baliwebserver, Apr 26, 2011 IP
  14. ProtoPC

    ProtoPC Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    All great points listed above...but for me also check for installed modules or components that ping the server alot...like any ajax type refreshing modules or chat apps.
     
    ProtoPC, May 7, 2011 IP
  15. HavenX

    HavenX Member

    Messages:
    277
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #15
    Try enabling the cache plug-ins one of some ways to speed up your joomla site and remove all modules, plugin, components that are not in use. Use the compression settings to compress your pages and CSS if your hosting allows it.
     
    HavenX, May 14, 2011 IP