LUA Slow File Append
Posted: 06 Dec 2011 13:09
The FH LUA file system runs very slowly sometimes.
In some situations it appears to have frozen FH in a 'hung' state.
The following LUA Plugin exhibits the problem and takes nearly a minute to complete:
for i=1,500 do
file, err = io.open('Test.log','a')
if file == nil then error(err) end
file:write('Data:0,1,'2'n')
file:close()
end
The following elements must be present in the written line:
The word Data: at start or end of line
Some commas , separating other data
Pair of quotes ' or '
If a line such as file:write('Data=0 1 (2)n') is used instead, it completes within a second or two.
The problem appears to be not so much what is being written, but that the above key elements exist in lines in the file being appended.
It afflicts Windows 7 and Vista but not my copy of XP.
The problem came to light because my LUA Plugin was writing a log file using the word Data: and contained commas and quotes.
As the file grew large the LUA Plugin took several minutes to complete the log, and appeared to have 'hung'.
If the word Data: was changed to Data= it completed in a second or two.
ID:5616
In some situations it appears to have frozen FH in a 'hung' state.
The following LUA Plugin exhibits the problem and takes nearly a minute to complete:
for i=1,500 do
file, err = io.open('Test.log','a')
if file == nil then error(err) end
file:write('Data:0,1,'2'n')
file:close()
end
The following elements must be present in the written line:
The word Data: at start or end of line
Some commas , separating other data
Pair of quotes ' or '
If a line such as file:write('Data=0 1 (2)n') is used instead, it completes within a second or two.
The problem appears to be not so much what is being written, but that the above key elements exist in lines in the file being appended.
It afflicts Windows 7 and Vista but not my copy of XP.
The problem came to light because my LUA Plugin was writing a log file using the word Data: and contained commas and quotes.
As the file grew large the LUA Plugin took several minutes to complete the log, and appeared to have 'hung'.
If the word Data: was changed to Data= it completed in a second or two.
ID:5616