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

Christophe David pmwiki at christophedavid.org
Mon May 28 10:35:45 CDT 2007


> 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.

> However, I've also been thinking that there should be an $ImportDelay
> parameter, which says that any given file (including .lastimport)
> has to be at least $ImportDelay seconds old before the script will
> process it.

Good protection indeed.

> 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.

If, as you described earlier, you set the timestamp of .lastimport in
the past when there are still files to be imported, as long as there
are visitors, the files will be imported.  Possibly without
interruption, causing high CPU load.

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...

This would in fact have no impact at all when importing only a few
files à a time.  But when the import files are generated by an
external application, we can easily have several hundreds in one go
and such a limit would be good to avoid causing troubles for the other
visitors.

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 ?

Christophe



More information about the pmwiki-users mailing list