Content deleted Content added
add {{WikiProject Lua/header}}. this page a tab? |
+section "Occasional timeout errors" |
||
Line 50:
== Plan for extensive debug-display code ==
As another issue of strategy, adding debug-display sections does not slow Lua code as it might the speed of markup-based template execution, because Lua can process hundreds of if-conditions at rapid speed. Even the addition of an extra if-statement for every Lua variable has little drag on speed, compared to slowing a template by perhaps 50% if adding similar if-expressions inside a markup template. Feel free to have many sections of debug-display added into a Lua module, or add several [[parameter validation]] tests as extra if-statements to check the values of variables to detect typical bad data.
== Occasional timeout errors ==
The Lua software was initially configured with a small, 10-second timeout limit, for the combined operation of all Lua code when formatting a page. By comparison, the markup-based templates have a 60-second timeout (6x higher time limit), and when the servers are slow, the markup-based templates could format perfectly, up through 59 seconds, but the Lua portions of templates will be stopped at the 10-second limit. The error message might be:
:: Lua 'script error': "The time allocated for running scripts has expired."
Unlike markup-based templates, the formatted page will contain "script error" for each further invoked Lua module, as text to store in the page-cache copy. The danger of the timeout limit occurs during the common periods of 2x slower server delay, where a 6-second Lua operation might slow to 12-second duration with busy servers, and thus garble the processing to store "script error" into the formatted page, for thousands of readers to view.
The overall effort appears unstable, or unreliable, as if Lua suddenly "gets too tired" and starts complaining by storing "script error" into the resultant page, where formatted text would have been expected instead.
== Support ==
|