Announcement

#1 2013-06-29 19:43:56

kyp_
Member
2013-06-17
84

Generating multiple size image - high cpu usage with i.php

Hi,

so I was wondering how other piwigo users do the following:

I'm always generating multiple size images after uploading new pictures, in order to fasten things up for visitors. Otherwise it would only be done when a visitor, well...visits it, which could be quite slow with lots of new images if I understood it right.

My trouble now is:
my site hoster is complaining when I do it (arvixe.com with a basic package).
they are complaining that the i.php is abusing cpu%

And since this batch process takes a few hours with 1000 or more pictures it will get noticed =)

Apprearently there is no willingness to limit the i.php process to a set amount of %, soo how do you guys handle it ? (well besides the obvious and not doing the image generating in the first place :P )


cheers
Kyp


Cheers

Offline

 

#2 2013-06-29 22:55:02

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: Generating multiple size image - high cpu usage with i.php

Hi kyp_,

kyp_ wrote:

I'm always generating multiple size images after uploading new pictures [...]

Only generate size M. This is the default size. Thumbnail size will be generated from M and it is "much" faster than generating from Original.


kyp_ wrote:

my site hoster is complaining when I do it (arvixe.com with a basic package).
they are complaining that the i.php is abusing cpu%

Thank you for reporting this problem. In addition to Piwigo.com, Arvixe is one of the 2 hosting providers we recommend on Piwigo.org hosting page. I'm going to ask them to give a detailed explanation about this "abusing CPU".


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

#3 2013-06-29 23:10:05

kyp_
Member
2013-06-17
84

Re: Generating multiple size image - high cpu usage with i.php

Thx for the info.
I've generated Sq, Th, M, L, XL so "Automatic Size" plugin could choose better for different screen resolutions. (at least thats what I was hoping for)

Arivxe Support asked me to remove i.php from the webspace. I'm guessing it's essential, so.... I'm trying to convince them I will not do any generate image's anymore manually but let the server do it in the background when  a visitor views it.


cheers
Kyp


Cheers

Offline

 

#4 2013-06-29 23:25:05

flop25
Piwigo Team
2006-07-06
6920

Re: Generating multiple size image - high cpu usage with i.php

I already had issues with my own hoster : one single person was visiting a private gallery and was generating many pictures, and i.php was baned (set the chmod to 000)
one day, 3hr, one user, I never was able to get back i.php so I created a.php a rename of the same file and also changed the unique line of code which was referring to i.php: that worked well ^^


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2013-06-29 23:38:15

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: Generating multiple size image - high cpu usage with i.php

flop25 wrote:

[...] I created a.php a rename of the same file and also changed the unique line of code which was referring to i.php: that worked well ^^

If we need such tricks on Arvixe, it won't be listed on Piwigo.org "hosting" page anymore, of course. I've sent them an email, I hope they will give more explanations and solution.


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

#6 2013-06-29 23:39:30

kyp_
Member
2013-06-17
84

Re: Generating multiple size image - high cpu usage with i.php

Had the same idea of just renaming it and renaming the appropriate code ;)

And thx for the insights so far.

cheers
Kyp

Last edited by kyp_ (2013-06-29 23:40:58)


Cheers

Offline

 

#7 2013-07-22 21:35:52

faqvideo
Member
2012-01-21
114

Re: Generating multiple size image - high cpu usage with i.php

Just a note on hosting provider - I am hosting with the DreamHost, and I also prefer to generate multiple size images manually. They seem to be happy with me - never heard any complains.

On a practical note - I am using Stripped-and-columns for desktops. Within this particular theme the choice of the viewing size is unavailable for the viewers. So I guess I need to generate the XL for desktops and M for mobile devices. Is there anything else that may be used automatically based on browser settings?

Offline

 

#8 2013-07-22 22:07:43

flop25
Piwigo Team
2006-07-06
6920

Re: Generating multiple size image - high cpu usage with i.php

Hello 
The config of stripped is applied to Stripped and columns too


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#9 2013-07-22 22:11:38

faqvideo
Member
2012-01-21
114

Re: Generating multiple size image - high cpu usage with i.php

Yes, thank you. I am using XL as a default size. But after I removed other sizes, I was getting into trouble with iPhone and iPad. I believe I had to restore the M size, so the images could be retrieved to be used with the mobile theme. Am I right here?

Offline

 

#10 2013-07-22 22:23:41

flop25
Piwigo Team
2006-07-06
6920

Re: Generating multiple size image - high cpu usage with i.php

There is an option in the local config for the default size on picture page,  for standard themes, and its default value is medium


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#11 2013-07-22 22:42:31

faqvideo
Member
2012-01-21
114

Re: Generating multiple size image - high cpu usage with i.php

Thank you, now it makes sense to me.

I have also asked in another thread, but hope you don't mind me mentioning it here since it is relevant - how can I get a URL of a particular image resized to M and watermarked? I'd like to use it in blogs etc.

Offline

 

#12 2013-07-22 23:17:39

flop25
Piwigo Team
2006-07-06
6920

Re: Generating multiple size image - high cpu usage with i.php

for wordpress you have a wp plugin
generally you can use mypiwigo/_data/i/galleries/myalbum/filename-me.jpg


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#13 2013-07-22 23:31:07

faqvideo
Member
2012-01-21
114

Re: Generating multiple size image - high cpu usage with i.php

It works! Thank you.

Offline

 

#14 2013-10-02 23:22:24

mbaumser
Member
2009-03-26
36

Re: Generating multiple size image - high cpu usage with i.php

I seem to be having the same issue but I'm not sure I understand the solution
my host is Hostmonster and they are complaining about the number of files I have.
each image I upload generates four.   me, sm, sq, th

what do I need to change so that these are not all generated?

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact