minicron icon indicating copy to clipboard operation
minicron copied to clipboard

Execution UI slow with lots of output

Open LaszloHont opened this issue 7 years ago • 7 comments

e.g. loading 127.0.0.1:9292/execution/15 takes more than a minute with ruby using 100% cpu

LaszloHont avatar Jun 15 '17 17:06 LaszloHont

I think that the problem is when the application being called from cron outputs a line that clears itself (like for an interactive shell, with ^L to clear the line). Then the output gets very long and minicron gets slow.

LaszloHont avatar Jun 15 '17 17:06 LaszloHont

How much is a lot? You can check in the database how many lines of output it has. If you run the server in debug mode you can see what queries are being run also, that may give a clue what the problem is.

jamesrwhite avatar Jun 15 '17 21:06 jamesrwhite

22 seconds to render in the web interface less than a second to select in sqlite3

sqlite> select count(*) from job_execution_outputs where execution_id=19;
45971

LaszloHont avatar Jun 16 '17 17:06 LaszloHont

This was almost the samec cron job with the --verbose flag removed. With the flag still on it would have been more than ten times as much output.

LaszloHont avatar Jun 16 '17 17:06 LaszloHont

Can you run the server with the --debug and --verbose flag and see what it outputs? You should be able to see the execution times for all the queries which will hopefully point to the issue.

jamesrwhite avatar Jun 25 '17 19:06 jamesrwhite

The easy fix for this issue is for minicron to run the cron commands (or users be told to run the cron commands...) with a TERM setting that does not clear anything. Perhaps TERM=dumb

LaszloHont avatar Jul 02 '17 21:07 LaszloHont

The UI should be able to handle a job with any amount of output. I think there are two fixes here:

  • Put a sensible limit on how much output the UI requests and then it can load more as you scroll down the page.
  • Some kind of fix for terminal clearing like you describe or the client could be smarter in how it handles it perhaps.

jamesrwhite avatar Jul 02 '17 22:07 jamesrwhite