S
S
skyfly20102020-08-28 12:45:57
PHP
skyfly2010, 2020-08-28 12:45:57

What is more important when processing photos RAM or CPU?

Dear experts. Help me deal with one question regarding photo processing with php tools. The task itself is rather banal: 20 photos are uploaded to the site, each 7 mb. It is necessary to make two small copies of each of them 960x720 and 240x180. The procedure itself does not raise any special questions and is solved using the toolkit AcImage. If we are talking about processing a single image - zero questions. Everything runs smoothly. If we cycle through 20 images, then the script does not have time to process all the images; its execution is reset by the server. Now standard hosting is used, of which there are a lot of data processors on the Internet, but 128 MB in RAM. Because the number of pictures is assumed to be large, then the issue of acquiring a server from a hosting provider is being considered. Here the important question becomes, what should be emphasized more? Take an additional 1 vCPU or 2 (4) GB of RAM.

Can anyone shed some light on whether 1GB of RAM and a vCPU with the following specifications will be enough to process the specified number of photos: Standard series Intel Xeon E5 processors are used. The base core frequency is not lower than 2.4 GHz.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Adamos, 2020-08-28
@skyfly2010

The procedure itself does not raise any special questions and is solved using the AcImage toolkit.

Why for such a simple task some kind of toolkit that eats memory for its abstractions? Throw the pictures into a folder that convert shovels on the crown (there is ImageMagick on the server for sure?) - and no puff restrictions will soar in principle.

M
maaGames, 2020-08-28
@maaGames

In theory, if the processing goes exactly in a cycle (that is, in turn !!!!), then it makes no difference 1 or 100500 photos. Upload, process, upload, the next photo.
It seems that the limitation is on the processor (on the script execution time). As an option, send images to the server one at a time and run the script for each image separately.
Those. I'm 100% sure the code needs to be redesigned, just buying more power masks the problem. but doesn't solve it. There will be not 20, but 30 images and again there will be a timeout. There will be a resolution higher and again there will be a timeout. I would try redesigning the code.

A
Alexey Cheremisin, 2020-08-28
@leahch

Why not resize images on the fly and cache them? - https://habr.com/ru/post/489544/
Most likely:
- all images do not need to be resized by definition,
- you do not need to store resizes that have not been requested for a long time
- you need to cache resizes for a day or two maximum
- everything will be done automatically!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question