[pLog-svn] Improving performance of summary.php

Mark Wu markplace at gmail.com
Sun Nov 27 18:19:55 GMT 2005


I sounds great. :D 

Mark

-----Original Message-----
From: plog-svn-bounces at devel.lifetype.net
[mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Oscar Renalias
Sent: Monday, November 28, 2005 1:20 AM
To: plog-svn at devel.lifetype.net
Subject: Re: [pLog-svn] Improving performance of summary.php


On 27 Nov 2005, at 17:01, Mark Wu wrote:

> Hi Oscar:
>
> I prefer the first way.
>
> I discussed this issue with pixnet's(biggest photo sharing site in
> Taiwan)
> adminstrator before, he told me he generate these information 1 time 
> per hour. He suggest us doing this in 2 levels:
>
> 1. Setting a time fence (can changed by administrator), when user 
> launch the summary page, summary page will check the cache is expired 
> or not, if yes, summary page will caculate these information again. 
> (The generate process still controlled by PHP thread, sometimes it 
> will slow down someone's speed, we don't know who)

This is actually easier than it seems. Smarty's implementation of a cache
includes a lifetime for cached pages, so all we need to do  is set the
lifetime to the same value that an admin set in the user interface. Smarty
will take care of resetting the page when needed.

We do need a few changes in CacheCotrol, to avoid resetting the summary
cache if the configured lifetime is greater than 0.

>
> 2. The same as above, but use another program (PHP script, or other  
> script)
> to generate this summary page cache and controlled by cron tab.  
> (This way is
> more effective for big site) --> Pixnet use this way.
>

I think these two options can work together: admins configure the  
lifetime of the summary page to let's say, 15min, and then a cron  
script runs every 15min and 1sec to automatically rebuild the page.  
This would avoid the possibility of somebody getting a slow summary  
page...

Oscar

> Mark
>
>
> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Oscar  
> Renalias
> Sent: Sunday, November 27, 2005 9:24 PM
> To: plog-svn at devel.lifetype.net
> Subject: [pLog-svn] Improving performance of summary.php
>
> Let's face it, summary.php is still slow :-)
>
> I was thinking about this and I found two possible solutions (that  
> are not
> mutually exclusive, by the way):
>
> - Somebody logged a feature request in mantis asking for summary  
> templates
> that are not removed when a change in data occurs, but instead,  
> that expire
> after a certain period of time. Something like
> 15 min or so. This would confuse some users but we would only need to
> generate the front page 4 times per hour, instead of many more in  
> case of
> busy sites.
>
> - Instead of calculating the lists of most recent and commented  
> articles,
> blogs, etc every time we generate the front page of summary.php, we  
> should
> calculate these lists every time somebody posts, updates or deletes an
> article and then  store the id of these articles and blogs in some  
> temporary
> table. This would slow down operations with blog articles but should
> theoretically speed up loading summary.php.
>
> I haven't tested any of these approaches yet. But does anyone have any
> comments or further ideas?
>
> Oscar
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.plogworld.net/mailman/listinfo/plog-svn
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.plogworld.net/mailman/listinfo/plog-svn
>

_______________________________________________
pLog-svn mailing list
pLog-svn at devel.lifetype.net
http://devel.plogworld.net/mailman/listinfo/plog-svn




More information about the pLog-svn mailing list