0
Answered

Thumbnail creation on 1&1 shared hosting

andreaslukas 4 months ago • updated 3 months ago 23

The thumbnail creation on 1&1 shared hosting is not working reliable. It is a game of luck if all thumbs are genereated and wich are left out. Espacially jpegs with each more than 1MB cause problems. Does somebody have experience with the server configuration?

I though it is not possible on the shared hosting but shortly I experienced, that other cloud-products can do it fully reliable - so it must be possible?

Answer

Answer
Answered

On "Performance Level 2", 600 is the number of PHP processes started in a 60 seconds interval. If you browse between folders, it's easy to hit that limit, without having to have hundreds of photo files in a folder.

It's a budget hosting plan, suitable for lighter use. 

Your options are: 

- Upgrade to a plan that allows more processes.

- Use the "make_thumbs.php" command line script (http://docs.filerun.com/command_line_tools) to generate the thumbnails beforehand.

For more details on choosing a suitable hosting service for FileRun, please check this page: http://docs.filerun.com/hosting

As ImageMagick is pre-installed on 1&1 shared hosting. But the problem appears both with and without Imagemagick. It seems to me like limited hardware-resources. After page-reload sometimes every thumb is shown but not everytime.

I also tried with other self-hosted cloud solution and it did it´s job with both small and bigger jpg-files (around and over 2MB). It did it slower and one by one - but reliable.


That shows that it is possible even on the cheap hosting ;-)



There are many happy FileRun users using 1&1 shared hosting services, so that is not a concern.

I am asking about your particular setup. Please provide a screenshot of the result you see when clicking to test for ImageMagick, and also provide more details about the files, their types, sizes and also information about your browser (given that seems to be unreliable for you, showing the same images on and off).

Thanks Vlad. I now added my documentation with screenshots as pdf. And

also a jpeg file wich is one of the images that do not get a thumnail or
a preview.


Filerun_Issues.pdf





We do not support the case when ImageMagick is not in use. FileRun is designed to be used with ImageMagick.

I see that thumbnails do get generated for you when ImageMagick is in use, so I am not sure what the problem is.

Thank you for that information - it was not obvious.


If you have a look at this screenshot from my pdf file - you´ll see that even ImageMagick leaves out some thumbs.

Now I tested again, even with heavier files and it worked for every folder - maybe it has to do with the server´s workload.


I will keep this issue in observation. For now it seems okay.




The sorting issue is a big problem to me. I´ll post some screenshots under another topic. If you can help with this issue it seems that I can stay with Filerun in future, what I would prefer.


Becaus I simply like it ;)


I think I found something important.


It works great under http but not in https!!

With https it looks like this (ImageMagick active):

There isn't any difference whatsoever on the PHP/FileRun side if you access via HTTP or HTTPS. If sometimes the thumbnail gets generated and sometimes is not, it can be, as you mentioned above, because the server temporarily ran out of resources to complete the request. It can easily happen, particularly when there are many requests at the same time, as in the case of loading a weblink with many photo images. Loading the weblink again, should load more thumbs, if that is the case, as the ones loaded previously have been cached, so FileRun/PHP can focus on the remaining ones.

Thank you Vlad. Let me conclude: It seems that the server runs temporarily out of resources when creating many thumbnails at one time. This happens only in https - in http mode every thumbnail is created reliable. Seems that https has extra restictions in my hosting package or it simply needs more resources from the server.


So far so good. I experienced another cloud-solution where even in https mode every thumbnail is created. Here it happens slower and one after another but RELIABLE - wich is good! Another good method is used there: additional pictures load only when scrolling to them. Like this is often the case for image-galleries and still provides a good user-experience.


From a software point of view it makes more sence to me if a process (thumb-creation) takes longer if resources are low instead of abording the process.


After page reload = just the same pics are left out. And page reload is not an option for my customers.



Do you see a chance in playing with this values:

php_value memory_limit 256M
php_value max_execution_time 300

?



Thx.



It is strange, I found out that the missing thumbnails issue appears only on firefox. Even in my firefox on mobile and on other computers. I cleaned up firefox but still the same problem.

Everything runs perfectly on Microsoft Edge.

I found out that the missing thumbnails issue appears only on firefox.


Even in my firefox on mobile and on other computers.


I cleaned up firefox but still the same problem.

Everything runs perfectly on Microsoft Edge.


??

Maybe I can use my filemanager via https and shared weblinks via http? Would you recommend this from a security point of view?



Thx.

If you serve parts of a website through http at a website which gets served over https this will break the SSL Certificate.

So Serving parts of the site over http when the webite itself get served over https does not make sence

Thank you for that! I thought about using shared links and Fileruninterface from different subdomains. One is configured with https and another without. I think about how to automate this in the creation of public links.

According to the picture with the left-out thumbnails we have this error log:


[09-May-2018 10:06:03 UTC] PHP Warning:  exec(): Unable to fork [/usr/bin/convert -size '400x400' "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/IMGP2272.JPG" -auto-orient -thumbnail '400x400^>' -strip -quality 95 "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/.filerun.thumbnails/IMGP2272.JPG/2385806/400_400_cover[1].png" 2>&1] in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php on line 101
[09-May-2018 10:06:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php:101) in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Thumbs.php on line 315
[09-May-2018 10:06:03 UTC] PHP Warning:  exec(): Unable to fork [/usr/bin/convert -size '400x400' "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/IMGP2263.JPG" -auto-orient -thumbnail '400x400^>' -strip -quality 95 "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/.filerun.thumbnails/IMGP2263.JPG/2219696/400_400_cover[1].png" 2>&1] in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php on line 101
[09-May-2018 10:06:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php:101) in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Thumbs.php on line 315
[09-May-2018 10:06:03 UTC] PHP Warning:  exec(): Unable to fork [/usr/bin/convert -size '400x400' "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/IMGP2265.JPG" -auto-orient -thumbnail '400x400^>' -strip -quality 95 "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/.filerun.thumbnails/IMGP2265.JPG/2464620/400_400_cover[1].png" 2>&1] in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php on line 101
[09-May-2018 10:06:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php:101) in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Thumbs.php on line 315
[09-May-2018 10:06:03 UTC] PHP Warning:  exec(): Unable to fork [/usr/bin/convert -size '400x400' "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/IMGP2290.JPG" -auto-orient -thumbnail '400x400^>' -strip -quality 95 "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/.filerun.thumbnails/IMGP2290.JPG/2977343/400_400_cover[1].png" 2>&1] in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php on line 101
[09-May-2018 10:06:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php:101) in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Thumbs.php on line 315
[09-May-2018 10:06:03 UTC] PHP Warning:  exec(): Unable to fork [/usr/bin/convert -size '400x400' "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/IMGP2272.JPG" -auto-orient -thumbnail '400x400^>' -strip -quality 95 "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/.filerun.thumbnails/IMGP2272.JPG/2385806/400_400_cover[1].png" 2>&1] in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php on line 101
[09-May-2018 10:06:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php:101) in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Thumbs.php on line 315
[09-May-2018 10:06:03 UTC] PHP Warning:  exec(): Unable to fork [/usr/bin/convert -size '400x400' "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/IMGP2263.JPG" -auto-orient -thumbnail '400x400^>' -strip -quality 95 "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/.filerun.thumbnails/IMGP2263.JPG/2219696/400_400_cover[1].png" 2>&1] in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php on line 101
[09-May-2018 10:06:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php:101) in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Thumbs.php on line 315
[09-May-2018 10:06:03 UTC] PHP Warning:  exec(): Unable to fork [/usr/bin/convert -size '400x400' "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/IMGP2265.JPG" -auto-orient -thumbnail '400x400^>' -strip -quality 95 "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/.filerun.thumbnails/IMGP2265.JPG/2464620/400_400_cover[1].png" 2>&1] in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php on line 101
[09-May-2018 10:06:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php:101) in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Thumbs.php on line 315
[09-May-2018 10:06:03 UTC] PHP Warning:  exec(): Unable to fork [/usr/bin/convert -size '400x400' "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/IMGP2290.JPG" -auto-orient -thumbnail '400x400^>' -strip -quality 95 "/kunden/homepages/17/d575845098/htdocs/_Cloud1/Fotos Test/Baustoffe/.filerun.thumbnails/IMGP2290.JPG/2977343/400_400_cover[1].png" 2>&1] in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php on line 101
[09-May-2018 10:06:03 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Resizers/ImageMagick.php:101) in /homepages/17/d575845098/htdocs/FileRun/system/classes/vendor/FileRun/Thumbs/Thumbs.php on line 315



Can we make the thumbnails smaller for a faster creation?


It can be that the server has a hard limitation set on how many external processes (such as "convert" for ImageMagick) PHP can run at the same time, to save the server resources. This is quite common on shared hosting servers. You most probably won't have this issue with a VPS.


Can we make the thumbnails smaller for a faster creation?

No, sorry. The size is fixed and designed for sharpness.

Thanks again for you fast answering!


That is what I am asking: if I can run it on 1&1 shared hosting. The only thing I want to find out if it is possible with this specifications:


Performance Level 2

Ram 6GB (guaranteed: 3GB)
Processes minute 600
Memory Limit


How can there be over 600 processes if there are not even 100 photos in the folder??

Thanks you again.

Answer
Answered

On "Performance Level 2", 600 is the number of PHP processes started in a 60 seconds interval. If you browse between folders, it's easy to hit that limit, without having to have hundreds of photo files in a folder.

It's a budget hosting plan, suitable for lighter use. 

Your options are: 

- Upgrade to a plan that allows more processes.

- Use the "make_thumbs.php" command line script (http://docs.filerun.com/command_line_tools) to generate the thumbnails beforehand.

For more details on choosing a suitable hosting service for FileRun, please check this page: http://docs.filerun.com/hosting

Maybe we come closer to the answer.


Some time ago you told me that thumbnails for the shared links are always generated when opening the page. This means for every page visitor thumbnails are generated every time again.

So I asume, that the command line script can not help for this case!?


"It's a budget hosting plan..."

This is what I am asking since months if it can run on a shared hosting plan. I just wonder why Owncloud and Nextcloud can do it reliable.


I talked to the guys at 1&1: Every webhosting has a limitation of 18 processes simultaniously. Even the best Webhosting Plan. The alternative is dedicated or managed server.


I would love to have FileRun because it has a much better User-Interface and experience ;-)


I just need the answer to the question: Is it possible to run on 1&1 Webhosting or not? I still do not give it up ;-))



This means for every page visitor thumbnails are generated every time again.

No, thumbnails are generated only once. Subsequent requests load the data from the cache.


I just wonder why Owncloud and Nextcloud can do it reliable. 

FileRun does it very reliably too. Fast as well. It's your hosting service which prevents it from working as designed. Looks like slow is good in this case.


Is it possible to run on 1&1 Webhosting or not?

Looks like it's running. Having limitations from the hosting service that are causing troubles when you trying to load many thumbnails for the first time, at the same time, does not qualify for a negative answer to the above question.

This seems to be a passable way to do it!


How can I access the command line tool. My skills are enough to use the ssh client for the webspace. But how can I use the FileRun command line?


Thx,

Andreas







After connecting via SSH, browse to the FileRun installation folder, inside the "cron" folder:

cd /path/to/filerun/cron

Then run:

php make_thumbs.php superuser

If getting PHP errors, you might need to specify the location of the PHP configuration file that is in use by your FileRun installation. The web server is in charge with loading a particular config file. Via command line, the default php.ini file is used, which might not meet FileRun requirements:

php -c /path/to/php.ini make_thumbs.php superuser

To find out which "php.ini" file is in used by FileRun, you can create a file "info.php" inside the FileRun installation folder, place the following code inside:

<?php phpinfo();

Access the file's URL in your browser, and look for information on "Loaded Configuration File". It should point to the file's full path.

I tried to execute make_thumbs.php ore any other through ssh. In ssh 1&1 uses php version 4.4.9 by default if you run a command like this:

php make_thumbs.php superuser


It has to be run like this to make it work:

/usr/bin/php7.1-cli -c /path/to/php.ini make_thumbs.php superuser


Do you think this fact can have a negative effect on how FileRun itself is executing all it´s php commands or cron jobs?