XU4 swapfile

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

XU4 swapfile

Post by johnvick »

Hi Fourdee,

A few times recently I get the 100% use swapfile warning message on the Cloudshell screen. I have 100 MB allocated. This persists until I reboot.

Is this anything to be concerned about? I assume so or else it wouldn't give a warning message?

Sometimes but maybe not every time this has happened has been when copying large files into ownCloud.

John
User avatar
Fourdee
Site Admin
Posts: 2787
Joined: Tue Feb 06, 2007 1:36 pm

Re: XU4 swapfile

Post by Fourdee »

johnvick wrote:Hi Fourdee,

A few times recently I get the 100% use swapfile warning message on the Cloudshell screen. I have 100 MB allocated. This persists until I reboot.

Is this anything to be concerned about? I assume so or else it wouldn't give a warning message?

Sometimes but maybe not every time this has happened has been when copying large files into ownCloud.

John
Hi John,

The temp upload directory is

Code: Select all

/var/tmp/php_upload_tmp
(disk). As for why its possibly using up memory, not sure.

Can you please give results for:

Code: Select all

df -h
cat /etc/sysctl.conf | grep swap
cat /etc/php5/apache2/php.ini | grep upload_tmp_dir
cat /etc/php5/cli/php.ini | grep upload_tmp_dir
cat /etc/php5/fpm/php.ini | grep upload_tmp_dir
cat /etc/php5/cgi/php.ini | grep upload_tmp_dir
In the mean time, try increasing the swapfile size:

Code: Select all

dietpi-config
#advanced options
#swapfile size
#try 1000
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: XU4 swapfile

Post by johnvick »

Hi Fourdee,

Code: Select all

root@Odroid:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       110G   27G   78G  26% /
udev             10M     0   10M   0% /dev
tmpfs           399M  6.9M  392M   2% /run
tmpfs           996M     0  996M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           996M     0  996M   0% /sys/fs/cgroup
tmpfs            10M  1.3M  8.8M  13% /DietPi
tmpfs           996M   16K  996M   1% /tmp
/dev/mmcblk0p1   71M   25M   47M  35% /boot
/dev/sdb1        15G  4.9G  9.1G  35% /mnt/usb_1
tmpfs           200M     0  200M   0% /run/user/0

Code: Select all

root@Odroid:~# cat /etc/sysctl.conf | grep swap
vm.swappiness=1

Code: Select all

root@Odroid:~# cat /etc/php5/apache2/php.ini | grep upload_tmp_dir
cat: /etc/php5/apache2/php.ini: No such file or directory

Code: Select all

root@Odroid:~# cat /etc/php5/cli/php.ini | grep upload_tmp_dir
upload_tmp_dir = /var/tmp/php_upload_tmp

Code: Select all

root@Odroid:~# cat /etc/php5/fpm/php.ini | grep upload_tmp_dir
upload_tmp_dir = /var/tmp/php_upload_tmp

Code: Select all

root@Odroid:~# cat /etc/php5/cgi/php.ini | grep upload_tmp_dir
;upload_tmp_dir =
I've installed php7 if that may be relevant?

John
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: XU4 swapfile

Post by k-plan »

johnvick wrote:I've installed php7 if that may be relevant?
Edit /etc/apt/sources.list and when apt-get install php7.* ?

Hmm, sorry, bad idea ....

As far as I know, php7.0 is still in beta and where is no application who need it coercively.

All dietpi-software, who need php, is optimise for php5 so far.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: XU4 swapfile

Post by johnvick »

Yes it is a bit cutting edge but I'd done it earlier on BPi and was so impressed with the performance boost I tried it on the XU4 and found the same. Do you think this could be behind the swapfile problem?
User avatar
Fourdee
Site Admin
Posts: 2787
Joined: Tue Feb 06, 2007 1:36 pm

Re: XU4 swapfile

Post by Fourdee »

johnvick wrote:PHP7 Do you think this could be behind the swapfile problem?
Possibly.

If i remember correctly, PHP uses the /tmp folder for uploads by default. As this is mounted to RAM in DietPi, may be the cause of out of memory.

We change the upload directory for PHP5, to a disk location during installation:

Code: Select all

cat /etc/php5/cli/php.ini | grep upload_tmp_dir
upload_tmp_dir = /var/tmp/php_upload_tmp
. Maybe PHP7 has a new or different option? Could even be a new config file location (eg: /etc/php7/cli/php.ini) , although, i'am not sure myself, haven't tried PHP7 yet.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: XU4 swapfile

Post by johnvick »

Hi Fourdee,

php7.0 uses the system default location for tmp files - I've changed the temp upload directory to the one you suggest - so will see if the the swapfile problem goes away.

John
User avatar
Fourdee
Site Admin
Posts: 2787
Joined: Tue Feb 06, 2007 1:36 pm

Re: XU4 swapfile

Post by Fourdee »

johnvick wrote:Hi Fourdee,

php7.0 uses the system default location for tmp files - I've changed the temp upload directory to the one you suggest - so will see if the the swapfile problem goes away.

John
Hi John,

Excellent. Fingers crossed :)
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: XU4 swapfile

Post by johnvick »

All good now swapfile use has at most been 3%.

Thanks again for your help.

John
User avatar
Fourdee
Site Admin
Posts: 2787
Joined: Tue Feb 06, 2007 1:36 pm

Re: XU4 swapfile

Post by Fourdee »

johnvick wrote:All good now swapfile use has at most been 3%.

Thanks again for your help.

John
Hi John,

Excellent, good to hear all is well. Thanks for letting me know :)

I'll be taking a look at PHP7 when I start work on Debian Stretch, but wont be for a while, at least until we get more requests for it: https://github.com/Fourdee/DietPi/issues/475

Basically Stretch is the next Debian release, newer software versions (eg: PHP7) but its still in "testing", so could be buggy: https://wiki.debian.org/DebianStretch
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply