PHP errors and ramdisk

Hi!

I have a lot of PHP errors in the log reader and i wonder if it is normal to have a bunch of errors. My Nextcloud is working fine so perhaps I just should just ignore them. One error I got a lot of is:
Method OC_L10N_String::__toString() must return a string value at /var/www/nextcloud/lib/private/L10N/L10N.php#85
I don’t understand the error messages as I don’t know much about PHP. Don’t know much about apache or Nextcloud either. I just like to use it :slight_smile:

I also have another question that might not be Nextcloud related, but I try anyway. I only have 8 Gb of ram. Is that enough to setup a ramdisk for /tmp and /var/tmp as described in this guide. (scroll down to “5.2 Server Tweaks”). I have Ubuntu Server with Nexcloud installed and nothing more. This is how much ram in use:
free -h
total: 7,4G
used: 428M
free: 5,9G
shared: 45M
buff/cache: 1,1G
available: 6,6G

Is it safe for me to setup a ramdisk?
Btw, I use Nexcloud 11.0.1, apache, mysql.

First make sure that you run php 5.6 or higher and you have all modules required installed (https://docs.nextcloud.com/server/11/admin_manual/installation/source_installation.html#prerequisites). The error message you are mentioning, has been seen before. You should report that on the bugtracker via https://github.com/nextcloud/server/issues (make sure no one else has already created an issue).

I would first install the server, use all the caching modules (apcu as memcache, and redis as file-locking cache), then have a look at database tuning (cache size). This way, many requests can be handled by data in your memory. I’m not sure if that much data is currently read from /tmp that a ramdisk will help so much. It also depends if you have SSD drives. Overall the ramdisk handling is a bit tricky, I would personally only do it if I have real benefits and wouldn’t do it as a standard procedure.

Hi and thank you for the respond!
I have all the modules required installed. The “PHP module mb multibyte” is called “mbstrings” I guess? I’ll go and add a bug report if no one has done it already about that specific error message. I still wonder if it is normal to have a bunch error-messages?

According to the install documentation:

For enhanced server performance (optional) select ONE of the following memcaches:

PHP module apcu (>= 4.0.6)
PHP module memcached
PHP module redis (>= 2.2.6, required for Transactional File Locking)

The package name i Ubuntu Server 16.04 is called “php-apcu”, and i installed that one. Then I followed this guide to set it up:
https://docs.nextcloud.com/server/11/admin_manual/configuration_server/caching_configuration.html?highlight=apcu#id1

Shall I set up PHP redis as well, and use both? Or maybe they are not the same thing? If I install it, shall I use the same guide as i linked to?

My server runs on a SSD, so maybe I wont gain any performance with a ramdisk. I did try with it on, but i didn’t noticed any performance gain the short time i used it. I only used it for a couple of hours, but then i started thinking it could be a stupid thing to use as I only have 8 Gb ram. Thinking it might freeze my system up if all my ram is used up (just like it would if I didn’t have a swap partition).

So, after some searching I think I can do this (have not tried it yet):

sudo apt-get install redis-server php-redis

Then add this to config.php:

'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
'filelocking.enabled' => 'true',
'redis' => array(
     'host' => '/var/run/redis/redis.sock',
     'port' => 0,
      ),

I will then use APCu for memcache.local and use Redis for memcache.locking. Seems this is the suggested way to do it according to the documentation. I’ll try this and see whats happens. Hope i dont mess up my Nextcloud now…