pierobot / mangapie

This is a self-hosted server for archived manga.
BSD 3-Clause "New" or "Revised" License
65 stars 9 forks source link

mangapie:watch 100% CPU Load #150

Closed kurim closed 4 years ago

kurim commented 4 years ago

Hello,

after having struggle to get it run... (also missing image.php in config??)

php artisan mangapie:watch creats 100% CPU Load on one core.

image

Envoirment: Ubuntu Ubuntu 18.04.4 PHP 7.4 with php-inotify

What did I wrong her?

donotos commented 4 years ago

Hi.

I had the same issue when i first installed Mangapie. I stoped using "watch" and put that line in my root crontab. it is not an instant update when you add a new chapter but it is good enough for me:

/5 * php /var/www/mangapie/artisan mangapie:scan >> /dev/null 2>&1

kurim commented 4 years ago

Thanks,

now I use this way as workaround:

tmux -> while true; do inotifywait -e create -e delete -r /var/www/mangapie/manga/ && php artisan mangapie:scan; done

pierobot commented 4 years ago

What errors did you get during installation? A missing image.php typically means the mangapie:init command failed.

As for the 100% CPU usage I don't see that on my end but I haven't tried it with just a single core. I'll set up a VM and see what happens.

donotos commented 4 years ago

I use a monocore VM too on my side.

pierobot commented 4 years ago

I ran into the same problem both of you are having with a single core VM. This commit fixes it on my end.

kurim commented 4 years ago

The init dont show any error it just do the job and thats it. image

Regarding CPU loag, its 99% of an 8thread system, but your commit fix it also for me thanks for that

//edit: also found another problem... the Favorits does not work.

(3/3) ErrorException
Undefined variable: sort (View: /home/kurim/public_html/mangapie/resources/views/shared/index.blade.php) (View: /home/kurim/public_html/mangapie/resources/views/shared/index.blade.php)

//edit2:

maybe not a real bug but an issue for me cause using of apache2 as proxy (dont want to rewrite all configs for ngnix) the pagenation is broken it links to: https://localhost:8888/home?page=2 instead of: https://domain.tld/home?page=2

pierobot commented 4 years ago

https://github.com/pierobot/mangapie/commit/81a5be3df393005e24a137a02a6a335e19aff909 Should fix the undefined variable.

As for your second problem, what do you have in APP_URL of your .env file? It should be https://domain.tld. If you make changes to your .env file be sure to run the php artisan config:cache command.

kurim commented 4 years ago

It was set to: https://domain.tld:8888

have now change it to: https://domain.tld

But this hase no impact on pagenation

Hm but something is now broken, after updating from git... no images will be loaded anymore

//edit: it might be better to have a working config for apache instead of using it as a proxy this will maybe solve some of the issues, but I'am not sure how the location from nginx need to translate

//edit2: after going back to this: https://github.com/pierobot/mangapie/commit/f9944c296c8021259b4257ab07e3f9339470d8d4 it's fine, it seems the windows branch break the linux version

pierobot commented 4 years ago

an issue for me cause using of apache2 as proxy (dont want to rewrite all configs for ngnix)

it might be better to have a working config for apache instead of using it as a proxy

Are you using nginx just for mangapie? If so, I can try writing a linux Apache guide so that you do not have to proxy to nginx. Should not be very different from the Apache on Windows.

kurim commented 4 years ago

Yes i just use nginx for mangapie, cause I dont find a good way to translate the ruls to apache So yeah I will be very happy if you can do a convert to apache

pierobot commented 4 years ago

Hello, please try the LAMP guide. I also pushed some changes to the master branch so make sure yours is updated.

kurim commented 4 years ago

Thank you this works fine, now i can remove nginx 👍 Thank you for your great work

pierobot commented 4 years ago

You're welcome. Feel free to open issues for any questions or feature suggestions.