webgui icon indicating copy to clipboard operation
webgui copied to clipboard

Task scheduler for internal operations

Open realies opened this issue 7 years ago • 6 comments

Certain back-end operations take up significant time to execute which affects user experience (reference: https://github.com/limetech/webgui/pull/290#issuecomment-372228431).

Perhaps there can to be an internal task scheduler for certain operations that happen without the user requesting them during page load time? That way webGui could consume recent updates instead of being the initiator for their generation.

realies avatar Mar 12 '18 08:03 realies

Caching mechanism in Docker container list information was broken, fixed in 6.5.1. On my system that cuts loading time in half (e.g. Dashboard takes 220ms to load 10 containers + 3 VMs)

bergware avatar Mar 20 '18 10:03 bergware

@bergware, when $display is set to docker at https://github.com/limetech/webgui/blob/a3fe701dfe0c44969f0fbc67594d47be6fbcc081/plugins/dynamix/include/DashboardApps.php#L20 still takes about ~1500ms to load the script when there is 32 container instances.

realies avatar Mar 20 '18 21:03 realies

These are my test results for complete loading + rendering of containers in Dashboard:

10 containers = 205 ms 20 containers = 562 ms 30 containers = 788 ms 40 containers = 1074 ms

bergware avatar Mar 20 '18 22:03 bergware

1000+ms seems like an unreasonable amount of time. Portainer takes 80-100ms for 33 containers.

realies avatar Mar 20 '18 23:03 realies

You can not expect a interpreted PHP script to perform at the same level as a compiled binary executable.

Fixing the caching issue gave already a great boost in performance, I don't see further optimizations, but if you see/have solutions to improve even more, please raise a PR and I am happy to test.

bergware avatar Mar 21 '18 00:03 bergware

@bergware, expecting lower difference between both. Have not inspected DockerClient in detail, but the information ca be flushed as soon it gets available, similarly to how logging.htm works. If implemented asynchronously, the results could get inserted in the DOM as soon as they become available in the JSON/XML response. This will improve page responsiveness, but perhaps there are back-end elements that could be improved. Happy to do a more detailed benchmark in the near future.

realies avatar Mar 22 '18 22:03 realies