Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Fatal error: Maximum execution time exceeded  (Read 4380 times)

0 Members and 1 Guest are viewing this topic.

iucdt

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Fatal error: Maximum execution time exceeded
« on: November 03, 2016, 03:18:29 am »

We are using Coppermine as a repository for stock photos we purchased. We have around 9000 images. Most of the photos have been added using FTP and the batch add files feature. When editing files to add keywords it has always taken a long time, but we have started getting "Fatal error: Maximum execution time of 60 seconds exceeded". I was able to stop the errors by extending the max_execution_time value defined in the php.ini to 90 seconds. However, I've just done another import of files and the errors have started again. I was able to extend the max_execution_time value to 120 seconds to allow for editing, but this is obviously not a problem that is going to go away.

I believe that part of the problem somehow lies with the keywords. When the files are imported there have been thousands of keywords automatically loaded into the system.

Does anyone have any insight into why this is happening and what I can do to fix it? As it is, I don't dare add any more images to the gallery.
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Fatal error: Maximum execution time exceeded
« Reply #1 on: November 03, 2016, 06:04:58 am »

Let's take a look at the SQL being issued.

Turn on DEBUG mode for admin at least (In config - Maintenance settings)
Edit files... (has to complete - if you exceed execution time we won't get the data)
On the resulting page at the bottom with be an expandable debug section.
Look for the SQL statements - each will have a file name, line number, and execution time with it.
Looking for LARGE numbers to see where the issue is - and post back here.

I have over 38,000 photos in my largest gallery - I know others have larger - and can edit with no issue...
The SQL should point us in the right direction to help you.
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Fatal error: Maximum execution time exceeded
« Reply #2 on: November 03, 2016, 11:28:09 am »

I would add that setting the time to 120 is not high by modern standards. I would doubt the number of images is having an effect here and like gmc suggests, it would be good to know what queries are causing the delays. If you are on a shared server, it could even be as simple as your server is sharing too many jobs at once. This results in a slow down or even a pause of running scripts taking them past the limits.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

iucdt

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Fatal error: Maximum execution time exceeded
« Reply #3 on: November 03, 2016, 03:02:42 pm »

Here's the results when I edit a file and click "apply changes" on an image. I'll attach it as a text file. 

Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Fatal error: Maximum execution time exceeded
« Reply #4 on: November 03, 2016, 10:20:15 pm »

Thanks for the data.. Reviewing - it doesn't appear the issue is Coppermine... or responsiveness of MySQL...
The two longest queries took 15ms (obtaining keywords) and 11ms (updating pictures table).
Code: [Select]
...
[20] => SELECT keywords FROM kdu_pictures WHERE keywords <> '' [plugins/auto_tag/codebase.php:28] (14.55 ms)
...
[22] => UPDATE kdu_pictures SET keywords = 'Travel;Ancient Civilization;Tourism;Stone - Object;Lost;Archaeology;Cusco City;Inca;Scenics;Awe;History;The Past;Journey;Green Color;Ancient;Old;Famous Place;Tourist;Rock - Object;Cliff;Andes;Mountain;Valley;Old Ruin;macchu;pichu;Picchu;Peru' WHERE pid = 8615 LIMIT 1 [plugins/auto_tag/codebase.php:81] (10.92 ms)
...
Combined 26ms (milliseconds) - or 0.026 seconds.  Adding up all SQL would appear to be well under 1 second (I didn't add - just looking at the scale of the numbers...)

I would suspect something else happening on the server - or a resource limitation (especially if this is a shared host - some are much better/worse than others...)  You may want to discuss with your hosting provider - or consider a different host.

I do agree with Phil that allowing higher times is the norm - but you shouldn't be waiting that long for this type of update... Major batch uploads (with resizing pics) is where I would expect to need that kind of time.
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

iucdt

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Fatal error: Maximum execution time exceeded
« Reply #5 on: November 03, 2016, 11:03:08 pm »

Thank you for your reply.
Coppermine is the only thing that is being affected on the server.

This Coppermine gallery sees very little use, probably 3 or 4 people per day, and I am the only one who is adding images to the system. I have one person who is putting in keywords on a regular basis and has been for a long time. He says that the edit feature has always been slow, but has gotten slower over time as I have added more images through the FTP/batch add process. The most recent addition I did was Tuesday and that was when the Fatal Error started showing up again.

I have a feeling that it has something to do with the keywords being added to the system when I do the FTP batch processing. When I look at the keyword manager it practically crashes my browser there are so many words. There is also a weird thing that happens if you look at a gallery's "edit files" option. If there is no keywords listed for a file but there is a description, it will copy all the words from the description into the keywords field when you click apply changes.

Can you think of anything else I might be able to check or help you might offer. I'm really at a loss  :(

Logged

iucdt

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Fatal error: Maximum execution time exceeded
« Reply #6 on: November 04, 2016, 12:44:09 am »

I believe that I just solved the problem. The behavior I mentioned about keywords being created from the description field was being caused by a plugin. I uninstalled the plugin and I no longer have the delay. Thanks so much for your help troubleshooting the problem and looking at my log script. It was a big help :)
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.