Page 1 of 1

lighttpd eats up all memory

Posted: Tue May 09, 2017 10:59 pm
by MonZon
I've had my RPI3 working fine for a month with those packages installed:
rpimonitor
zerotier-one
nextcloud
fail2ban
default lighttpd from distro
and netatalk installed manually from the source. (disabled it after a while)

Recently, I've updated my system using dietpi-update and now my server is unusable. After a few minutes after the boot lighttpd eats all the ram and system becomes unresponsible. I've managed to remove it - now the system is stable, but it is not doing what I want it to do - I mean the nextcloud service.

I've done a backup just before updating - restoration to it is not helping also.

Any help?
Thanks a lot!

UPD: I forgot to mention that my system is on HDD, not SD card.

Re: lighttpd eats up all memory

Posted: Wed May 10, 2017 1:59 pm
by Fourdee
Hi,

Can we see a screenshot of lighttpd memory usage in (to confirm its the culprit and not a combination of other programs):

Code: Select all

htop
And what is the size of swapfile on system, also, have you tried increasing it?
dietpi-config > advanced options > swapfile

Re: lighttpd eats up all memory

Posted: Wed May 10, 2017 3:52 pm
by MonZon
Here you go. It is kinda hard to catch the moment when the RAM is full, but the system is somehow responsive :lol: After some time it is almost unusable, but I can hear it infinitely swapping like mad :?
I use 1999Mb of swap - on USB HDD.

I'm starting to think that this problem is somehow related to nextcloud... But not sure yet.

Any other logs would be useful?

If I uninstall lighttpd - everything become normal.

Re: lighttpd eats up all memory

Posted: Wed May 10, 2017 5:29 pm
by Fourdee
MonZon wrote:Here you go. It is kinda hard to catch the moment when the RAM is full, but the system is somehow responsive :lol: After some time it is almost unusable, but I can hear it infinitely swapping like mad :?
I use 1999Mb of swap - on USB HDD.
Thanks,

Yep, looks like php and lighttpd might have a memory leak, or, cache size too big.
Any other logs would be useful?

Code: Select all

cat /var/log/lighttpd/error.log
cat /var/log/php5-fpm.logp
And lets check cache sizes, should be around 50/60MB each:
http://IP/apc.php
http://IP/opcache.php

Re: lighttpd eats up all memory

Posted: Wed May 10, 2017 6:21 pm
by MonZon
cat /var/log/php5-fpm.log

Code: Select all

[10-May-2017 16:17:22] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

[10-May-2017 16:17:22] NOTICE: fpm is running, pid 925
[10-May-2017 16:17:22] NOTICE: ready to handle connections
[10-May-2017 16:17:22] NOTICE: systemd monitor interval set to 10000ms
[10-May-2017 19:11:08] WARNING: [pool www] server reached pm.max_children setting (4), consider raising it
cat /var/log/lighttpd/error.log

Code: Select all

2017-05-10 16:17:20: (log.c.164) server started 
The cache size set to 32MB.

The OpCache has 618 scripts loaded just before the swapping begins. Do you need this huge list?

It is all I could copy for now - my system is locking itself up really fast. (I had to reboot twice in order to catch those files :lol: )

UPD: I've found this
Note
Lighttpd is not supported with Nextcloud, and some Nextcloud features may not work at all on Lighttpd.
here https://docs.nextcloud.com/server/9/adm ... oting.html

Shall we move nextcloud to nginx? How can it be done on DietPi?


UPD2: I've switched to nginx web server using dietpi-software package installer. It was really easy to do and it works much more stable and much faster than lighttpd. At the moment I can successfully use netatalk (TimeMachine backup), nextcloud with ~70GB of files and RPI-Monitor. All of this with 170-200MB of RAM consumed (on RPi3 board). Let's see it in the long run. So great! Thanks again for this great distro and support.

Thanks for your help!