Questions about caching and speed
Questions about caching and speed
Hi Ted and Co.
Just spent the last few days in the office playing around with CMSMS and it's absolutely brilliant. I'm about to roll it out to add CMS to four sites for various small businesses.
My only gripe is the speed - I guess I've got to wait until 2.0 rolls out so I can use full page caching, but I was wondering if there were any other options that I could use to speed it up? I notice 'caching' a couple of times in the source code... and I'm vaguely aware that Smarty has it's own caching system...
I've tweaked the 'Cache' plugin so that it actually works with content blocks (although to get the admin panel to pick up the blocks correctly I had to just have the plugin overwrite function.content.php (rather than creating the new function.ccontent.php). [I've literally just taken the guts out of ccontent and put it back into the right place in content, I can share if anyone wants it]
I'm getting on average ~1.5 seconds for each page load, sometimes I'm getting 0.3 seconds if I'm lucky. But that's on a small site with only 5 pages. On a slightly larger site with 30 pages I'm weighing in at ~10 seconds.
I'm using Dreamhost for hosting.
All of these sites are generally static site, so full page caching would work fine. Having implemented it into 2.0, could you give me any idea of whether it would be relatively easy to hack into 1.0.4?
Many thanks,
Rob Swan
Fuelled on Coffee Limited
Just spent the last few days in the office playing around with CMSMS and it's absolutely brilliant. I'm about to roll it out to add CMS to four sites for various small businesses.
My only gripe is the speed - I guess I've got to wait until 2.0 rolls out so I can use full page caching, but I was wondering if there were any other options that I could use to speed it up? I notice 'caching' a couple of times in the source code... and I'm vaguely aware that Smarty has it's own caching system...
I've tweaked the 'Cache' plugin so that it actually works with content blocks (although to get the admin panel to pick up the blocks correctly I had to just have the plugin overwrite function.content.php (rather than creating the new function.ccontent.php). [I've literally just taken the guts out of ccontent and put it back into the right place in content, I can share if anyone wants it]
I'm getting on average ~1.5 seconds for each page load, sometimes I'm getting 0.3 seconds if I'm lucky. But that's on a small site with only 5 pages. On a slightly larger site with 30 pages I'm weighing in at ~10 seconds.
I'm using Dreamhost for hosting.
All of these sites are generally static site, so full page caching would work fine. Having implemented it into 2.0, could you give me any idea of whether it would be relatively easy to hack into 1.0.4?
Many thanks,
Rob Swan
Fuelled on Coffee Limited
Re: Questions about caching and speed
Can you send it via pm? So I can include it in next release ...robswan wrote: I can share if anyone wants it]
Re: Questions about caching and speed
@cyberman : include in the next release of your cache hack or include an upgraded cache hack into 2.0 core to make it the "full page caching" feature ?
@robswan : meanwhile, if you have it, you can try Apache's mod_cache. If you don't have it, you can tell you "dream" hoster to provide it. Hosters should love mod_cache.
Pierre M.
@robswan : meanwhile, if you have it, you can try Apache's mod_cache. If you don't have it, you can tell you "dream" hoster to provide it. Hosters should love mod_cache.
Pierre M.
Re: Questions about caching and speed
@Pierre: 2.0 already has a full page caching feature in it using cache lite.
Re: Questions about caching and speed
provided everything is setup right, 10 seconds on a 30 page cmsms site would be considered SLOW. i'd drop phpsysinfo into your web space and see what exactly is running these sites... http://phpsysinfo.sourceforge.net/robswan wrote: I'm getting on average ~1.5 seconds for each page load, sometimes I'm getting 0.3 seconds if I'm lucky. But that's on a small site with only 5 pages. On a slightly larger site with 30 pages I'm weighing in at ~10 seconds.
I'm using Dreamhost for hosting.
i might expect 10+ second load times if i was serving on apache running on windows 98 (my text environment many moons ago), but not on a real production server. my cmsms sites typically run between 0.6 seconds and 4 seconds per page view (timed by fasterfox).. the slower times would be when the local pc doesn't have the dns cached or if a web page needs to pull some feeds with the rss module. otherwise, anything over 1 second i consider slow.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Re: Questions about caching and speed
I've been relying on the debug comment added to the bottom of the generated page to judge the time it's taken, e.g.kermit wrote: my cmsms sites typically run between 0.6 seconds and 4 seconds per page view (timed by fasterfox)
Code: Select all
<!-- Generated in 4.111695 seconds by CMS Made Simple using 25 SQL queries -->
I know a lot of this is going to be fixed by 2.0 doing full page caching, but sites that I currently have live (for example the site I just threw up at www.mcst.co.uk as a charitable favor) do seem to be a bit sluggish...
I'll look into phpsysinfo, maybe it's just Dreamhost being slow. Ta for the link.
Re: Questions about caching and speed
Hi Daniel,My site (www.dansoftaustralia.net) has an abnormally large number of queries (I think it's due to the number of times I used {cms_selflink ...} on the home page),
I had the same problem with my site having over 70 queries!
cms_selflink in the main template was causing an additional 30 queries just to display the header image with the link ...
removing (hardcoding)
{cms_selflink dir="start" text="$sitename"}
solved the problem.
The cms_selflinks in the content where not the problem, it was just this line in the template ... can only recommend not to use it here ...
tina
Re: Questions about caching and speed
Yes, Ted has suggested the use of such PHP accelerators several times.Daniel15 wrote: EDIT: If your host doesn't have it already, install eAccelerator. eAccelerator improves the load times considerably.
Pierre M.
Re: Questions about caching and speed
Maybe the problem comes from News module - please look here for a (german) solutiontkeil69575 wrote: I had the same problem with my site having over 70 queries!
http://forum.cmsmadesimple.org/index.ph ... l#msg24418
Re: Questions about caching and speed
Hi cyberman,
thanks for the suggestion, but no ... I disabled all modules, including news and it did not have any effect on the high number of queries. Removing the line as stated in my previous post, solved the problem. I now have 17-20 queries pp. and am very happy
greetings
tina
thanks for the suggestion, but no ... I disabled all modules, including news and it did not have any effect on the high number of queries. Removing the line as stated in my previous post, solved the problem. I now have 17-20 queries pp. and am very happy

greetings
tina
Re: Questions about caching and speed
I run CMSMS sites on servers with three different web hosts. All the sites are of similar size and make similar numbers of SQL queries to generate the page.
On only one of my three hosts does this problem occur - identical to yours: Networksolutions.com.
I have analysed the problem and I believe that this host has too high of a load on their shared MySQL server. So static pages and files load very fast, but any page requiring MySQL queries takes three to ten seconds to be generated.
The best solution is to call the host and complain about the MySQL server speed. If that doesn't work, consider changing to a new web host.
PS, here is an example of the site generation time from the three different hosts:
Site javajs.com hosted with Clinch Mountain Communications (0.017 seconds/query):
Site benlueders.com hosted on VDeck (0.024 seconds/query):
Site dominiontruss.com hosted on Network Solutions (0.245 seconds/query):
On only one of my three hosts does this problem occur - identical to yours: Networksolutions.com.
I have analysed the problem and I believe that this host has too high of a load on their shared MySQL server. So static pages and files load very fast, but any page requiring MySQL queries takes three to ten seconds to be generated.
The best solution is to call the host and complain about the MySQL server speed. If that doesn't work, consider changing to a new web host.
PS, here is an example of the site generation time from the three different hosts:
Site javajs.com hosted with Clinch Mountain Communications (0.017 seconds/query):
Code: Select all
<!-- Generated in 0.393048 seconds by CMS Made Simple using 23 SQL queries -->
Code: Select all
<!-- Generated in 0.688768 seconds by CMS Made Simple using 18 SQL queries -->
Code: Select all
<!-- Generated in 10.305407 seconds by CMS Made Simple using 42 SQL queries -->
Re: Questions about caching and speed
I just called Network Solutions about this again. They didn't admit it outright, but the tech told me they are upgrading to MySQL 5.0 next week.
So, what I think happened is they stopped upgrading their MySQL boxes to handle the growing load of their shared hosting sites, because they are setting up the new boxes with 5.0. This has caused the latency on the shared MySQL server to increase a lot.
If you are using a shared hosting plan and your page generation time is more than 1 second, there is probably an overloaded shared MySQL server to blame for it.
So, what I think happened is they stopped upgrading their MySQL boxes to handle the growing load of their shared hosting sites, because they are setting up the new boxes with 5.0. This has caused the latency on the shared MySQL server to increase a lot.
If you are using a shared hosting plan and your page generation time is more than 1 second, there is probably an overloaded shared MySQL server to blame for it.
Re: Questions about caching and speed
Still not having much luck with Network Solutions.
Further analysis of the problem with various hosts leads me to believe it is most likely to occur when MySQL is not on localhost. Ie., big hosting companies that have their MySQL set up as a farm have high latency with SQL queries. The only way to avoid this is to host with a company where the DB is run on the same box as the webserver, or get a virtual private server, or dedicated server.
In the meantime I am trying to get the ccache functions working with multiple content blocks to try to reduce the number SQL queries.
Further analysis of the problem with various hosts leads me to believe it is most likely to occur when MySQL is not on localhost. Ie., big hosting companies that have their MySQL set up as a farm have high latency with SQL queries. The only way to avoid this is to host with a company where the DB is run on the same box as the webserver, or get a virtual private server, or dedicated server.
In the meantime I am trying to get the ccache functions working with multiple content blocks to try to reduce the number SQL queries.