Website with Joomla very slow

Discussion regarding Joomla! 1.5 Performance issues.

Moderators: General Support Moderators, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security and Performance FAQs
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
eduaug1986
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sun Feb 20, 2011 5:38 pm

Website with Joomla very slow

Post by eduaug1986 » Wed Feb 23, 2011 11:05 am

Please guys, take a look at the follow website:

http://www.rosatropical.com

Is it common to be so slow like this?

Sometimes it takes 10 seconds to open first page...

And just for first page I have problems with slow access

User avatar
mako005
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 111
Joined: Thu Feb 05, 2009 10:08 am

Re: Website with Joomla very slow

Post by mako005 » Wed Feb 23, 2011 11:19 am

Hello,

No big issue there rating on speed of 80/100 and it is 'B' with Y - slow.
Ping rate average of 360 is awful but I am in Australia. Sometimes speed issues come down to your host location, without doing the big checks, hosting locally usually is much kinder.

My client ping rates average 17 milliseconds!!

Hope that helps. Mako :D

eduaug1986
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sun Feb 20, 2011 5:38 pm

Re: Website with Joomla very slow

Post by eduaug1986 » Wed Feb 23, 2011 11:44 am

Ping from Brazil, I got the follow result:

Disparando contra www.rosatropical.com [187.16.23.138] com 32 bytes de dados:

Resposta de 187.16.23.138: bytes=32 tempo=25ms TTL=56
Resposta de 187.16.23.138: bytes=32 tempo=24ms TTL=56
Resposta de 187.16.23.138: bytes=32 tempo=25ms TTL=56
Resposta de 187.16.23.138: bytes=32 tempo=25ms TTL=56


I guess the problem is not the time to connect to the server, but the time to load de website.

But I not sure if is this due to some issue with joomla. :S

almooj-craig
Joomla! Guru
Joomla! Guru
Posts: 500
Joined: Mon Aug 11, 2008 3:05 pm

Re: Website with Joomla very slow

Post by almooj-craig » Wed Feb 23, 2011 3:53 pm

The first time I tested your site it was from Dulles.VA USA and the time to first byte was 12603ms, then I tested from Sao Paulo Brazil and the time to first byte dropped to 1648ms and the second time it was 972ms. I then tested one more time from Dulles and it was 1171ms.

What kind of caching are you using? Perhaps it is expiring too soon because it seems like the first time the cache is built it takes a very long time 12603ms.

eduaug1986
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sun Feb 20, 2011 5:38 pm

Re: Website with Joomla very slow

Post by eduaug1986 » Wed Feb 23, 2011 7:26 pm

What is caching and how can I check it?

eduaug1986
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sun Feb 20, 2011 5:38 pm

Re: Website with Joomla very slow

Post by eduaug1986 » Wed Feb 23, 2011 7:48 pm

Now it is faster than never :D

I discovered that I had to active cache and Gzip on joomla global configuration :D

Thank you guy ;)

g1smd
Joomla! Guru
Joomla! Guru
Posts: 951
Joined: Mon Feb 21, 2011 4:02 pm
Location: UK

Re: Website with Joomla very slow

Post by g1smd » Thu Feb 24, 2011 11:50 am

One serious server performance hit comes from the current mod_rewrite rules invoking two physical "does this exist as a file?" and "does this exist as a folder?" disk read operations for every URL request hitting the server.

These are invoked even for URL requests that are never going to be rewritten to the Joomla index.php script. There are two such checks for every html page, every image, every stylesheet and every script; perhaps running to several dozen physical disk reads for every page requested on some sites.

Remember, these aren't disk reads to fetch the content, these are "does this resource exist as a file?" checks by the mod_rewrite processing. It is much later on that the resources are actually fetched from the hard disk in order to be served as content to the user.

New mod_rewrite rules are proposed which change the order of the "exist" checks, so that the very slow disk read operations are no longer invoked for every request. Instead they are now invoked only for those requests which might be handled by the index.php script.

The number of disk reads drops considerably with the new rules. This should provide a noticeable and measurable speed increase for every Joomla site using the new .htaccess file. The new file is "Ready to commit" in the 1.6 development branch. As far as I can tell, the new file should also work "as-is" for Joomla 1.5 installations.

http://joomlacode.org/gf/project/joomla ... m_id=22425

http://joomlacode.org/gf/download/track ... 5-rw.patch

Several other minor changes and performance enhancements are also built in to the new code.
Last edited by g1smd on Tue Mar 01, 2011 1:16 pm, edited 1 time in total.
Online since 1995.

eduaug1986
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sun Feb 20, 2011 5:38 pm

Re: Website with Joomla very slow

Post by eduaug1986 » Thu Feb 24, 2011 12:26 pm

Great, thank you very much for this suggestion.... looks like to be a really good improve.... but, how do I install 22425-rw.patch ?

g1smd
Joomla! Guru
Joomla! Guru
Posts: 951
Joined: Mon Feb 21, 2011 4:02 pm
Location: UK

Re: Website with Joomla very slow

Post by g1smd » Thu Feb 24, 2011 7:29 pm

Get the existing .htaccess file from your site, and make a backup copy of it.

Open one copy of the .htaccess file in a text editor.

Get the patch file, and open it in another text editor.

In the patch file, look for lines beginning with a + or - symbol.

Lines with a "+" are for addition to the .htaccess file.
Lines with a "-" are for removal from the .htaccess file.

Use the lines with no symbol as a guide for where they go.

That's the long-winded way of doing it.


The quick way is to use tools like TortoiseMerge or WinMerge but you need to be familiar with what you are doing before attempting to do this on code that you are going to put on a live site.
Online since 1995.

PaulPreston
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Sun Jan 30, 2011 12:53 pm
Location: London, UK
Contact:

Re: Website with Joomla very slow

Post by PaulPreston » Sun Feb 27, 2011 2:31 pm

In terms of "stat" on a file or directory.. by using .htaccess file you already cause apache to check if that file exists... On high performance websites every cpu cycle counts.

You can alternatively check if your system supports null file caching (cached response for stat requests.. if if diesn't invoke any IO to a permanent storage the performance should be much better). Obiously there are some other ways of improving IO, by putting your website to a ramdisk etc, but from my experience it gets to complicated in most situations - get a better hardware (which you would have to do anyway if you want to put more and more data in memory)

I think that joomla should be distributed with 2 ways of implementing SEF:
1. through a templated apache config file with AllowOveride none settings (perhaps it's reasonable to follow symlinks etc, but .htaccess file checks and usage should be disabled)
2. through a .htaccess file for 3rd party hosted environments

Kind Regards,
--
Paul Preston - Senior IT Consultant
http://www.proxar.co.uk

PaulPreston
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Sun Jan 30, 2011 12:53 pm
Location: London, UK
Contact:

Re: Website with Joomla very slow

Post by PaulPreston » Sun Feb 27, 2011 2:39 pm

Just a short extension of my post..

I remember that one of our clients had a NAS as a central storage running Solaris with no null file caching... (SUN x4140) and in order to improve performance we went throught a process of eliminating all the requests to a central storage for files that were not there. We have discovered that php path variable had number of directories which were not used, so with every single request php was looking for modules to include, sometimes it had to crawl through over 10 directories before it found one module. Changing the order of directories and removing unused directories in path variable introduced a significant performance improvement..

Good luck!
--
Paul Preston - Senior IT Consultant
http://www.proxar.co.uk

g1smd
Joomla! Guru
Joomla! Guru
Posts: 951
Joined: Mon Feb 21, 2011 4:02 pm
Location: UK

Re: Website with Joomla very slow

Post by g1smd » Mon Feb 28, 2011 2:12 am

The proposed new .htaccess file code, mentioned above, eliminates 95% of the -f and -d "exists" checks simply by changing the order the RewriteConds are processed in. That already shows a measurable performance increase.
Online since 1995.

eduaug1986
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sun Feb 20, 2011 5:38 pm

Re: Website with Joomla very slow

Post by eduaug1986 » Mon Feb 28, 2011 2:34 am

Too much technical this informations... there isn't a easier way to increase website perfomance?

g1smd
Joomla! Guru
Joomla! Guru
Posts: 951
Joined: Mon Feb 21, 2011 4:02 pm
Location: UK

Re: Website with Joomla very slow

Post by g1smd » Mon Feb 28, 2011 3:13 am

Tweaking the mod_rewrite rules in the .htaccess file is directly altering the server configuration.

In effect you're directly tinkering with the engine, and that's where a good performance boost can be achieved. If you're going to run a (successful) website, you're going to have to learn the tech.
Online since 1995.

eduaug1986
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sun Feb 20, 2011 5:38 pm

Re: Website with Joomla very slow

Post by eduaug1986 » Tue Mar 01, 2011 12:37 pm

Just manage.... I guess now is everything ok with my website...

I tested and it was faster... see bellow how is my htaccess:

Code: Select all

 @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule .* index.php [F]
#
########## End - Rewrite rules to block out some common exploits

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]


#
########## End - Joomla! core SEF Section




Thank you everyone.... :D

g1smd
Joomla! Guru
Joomla! Guru
Posts: 951
Joined: Mon Feb 21, 2011 4:02 pm
Location: UK

Re: Website with Joomla very slow

Post by g1smd » Sat Mar 05, 2011 12:06 pm

The patch has been updated with several more minor speed enhancements.

Please try it out sometime.
Online since 1995.

tappy52dog
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 115
Joined: Sat Dec 17, 2011 7:45 pm

Re: Website with Joomla very slow

Post by tappy52dog » Thu Feb 28, 2013 6:04 pm

Hi, G1SMD, are all these .htaccess improvements automatically part of Joomla 1.7 sites and above or is this a custom patch that you built only?

I have blocked entire countries (due to spam and scammers), I wonder of my htaccess file can significantly slow down a site by doing that and if there is a way to fix it?

g1smd
Joomla! Guru
Joomla! Guru
Posts: 951
Joined: Mon Feb 21, 2011 4:02 pm
Location: UK

Re: Website with Joomla very slow

Post by g1smd » Thu Mar 07, 2013 7:17 pm

The new code was added in 1.6 or 1.7 onwards, or thereabouts.

It's in all new versions.
Online since 1995.

tappy52dog
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 115
Joined: Sat Dec 17, 2011 7:45 pm

Re: Website with Joomla very slow

Post by tappy52dog » Fri Mar 08, 2013 12:41 pm

Okay, thanks for your feedback and 73s to ya.. :).


Locked

Return to “Performance - Joomla! 1.5”