[pmwiki-users] pagelists link= with pages generated externally

Patrick R. Michaud pmichaud at pobox.com
Mon May 28 11:01:38 CDT 2007


On Mon, May 28, 2007 at 05:35:45PM +0200, Christophe David wrote:
> >This isn't entirely accurate.  The visitors never see their requests
> >taking 15 seconds, as the pages are updated in the background _after_
> >each visitor's normal request is handled.  In other words, visitors
> >never see a delay in response time due to the import, unless they know
> >exactly what to look for.
> 
> On my system, the mouse cursor shows as an hourglass and the progress
> bar remains visible during the whole background process duration.

Correct, but having this appear wouldn't normally bother me, since
it comes after the page content has been sent.  

> >If one then sets $ImportDelay to 15, and leaves $ImportTime set at
> >15, the result would be that the system would spend at most 30
> >seconds out of each minute processing imports.  It also means
> >that $ImportFreq could be set at a very high number, which avoids
> >frequent scans of the import/ directory even when there's nothing
> >new to import.
> 
> If I understand correctly, this alone will not allow to prevent
> exceeding CPU limits.
> [...]

Oops, you're correct.  I could have $ImportDelay also compare
against the '.lastmod' timestamp, however, and that would do it.

> If instead you did not set the .lastimport timestamp in the past but
> would set it to current time, then no import would be performed before
> $ImportDelay, allowing the CPU to cool down...

But it would also mean that we have to wait $ImportFreq seconds
before importing again.  I know that in many cases admins will want
the imports to take place as quickly as they can, because CPU
usage isn't a bottleneck for them.

> I also wonder what happens when you reach the PHP timeout while
> importing.  Shouldn't $ImportTime be always shorter than the PHP
> timeout, in order not to have the PmWIki process aborted and files
> possibly not finalized ?
> 
> If yes, could PmWiki get this value and decrease $ImportTime
> accordingly when needed ?

AFAICT, PHP doesn't provide a reliable mechanism to know how 
much time remains in the current session.  We could make some 
guesses, but they'd often be wrong.

Also, the PHP timeout is measured in script execution time
(CPU seconds), while the $ImportTime timeout is measured in
wall-clock seconds.  So, a PHP timeout of 30 seconds typically
represents more than 30 wall-clock seconds, especially
when doing lots of disk operations (which don't count in the 
PHP timeout).

Stated the other way around, 15 wall-clock seconds is typically
less, and sometimes much less, than 15 script execution seconds.

Pm



More information about the pmwiki-users mailing list