wow! impressive ! Is the option --reload shipped with packages ? Because if I'm not wrong, it's "useless" in a production environment: you know when you update your Koha and you can restart plack manually or trough the packages post-update scripts, isn't it ? Le 09/09/2016 à 16:32, Jonathan Druart a écrit :
Hi devs,
A couple days ago I found that the --reload option of plackup causes a high CPU load (around 35%). If I remove it, the process is around 1% (when sleeping). So I have tried inotify2 (Linux::Inotify2) to add watchers and restart plack when a file is changed. But 1/ It's not recursive and I will have to script without knowing the perf impacts and 2/ It will be terrible when checking out another git branch (1 restart per file changed!).
After a talk with a friend, I decided to use a git hook and map a key in my vim config to do so:
The git hook: .git/hooks/post-checkout #!/bin/sh exec /usr/local/bin/restart_plack exit 0
The vim map command: map <F2> <Esc>:w<CR>:!(/usr/local/bin/restart_plack > /dev/null 2>&1)&<CR>a
And that's all :)
To be complete, here is my restart_plack script: http://pastebin.com/8wFSC4fJ
Cheers, Jonathan _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- Paul Poulain, Associé-gérant / co-owner BibLibre, Services en logiciels libres pour les bibliothèques BibLibre, Open Source software and services for libraries