Gallery 2 errors

wordpress

#1

My Gallery install is REALLY SLOW - like so slow it times out.
When trying to upload any more than 100 images (500x333 px ) it stops with an error.
I’m trying to delete some albums and I also get an error:

Error (ERROR_LOCK_TIMEOUT)

  • in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 718 (GalleryCoreApi::error)
  • in modules/core/classes/GalleryStorage.class at line 380 (GalleryStorageExtras::acquireWriteLock)
  • in modules/core/classes/DatabaseLockSystem.class at line 42 (GalleryStorage::acquireWriteLock)
  • in modules/core/classes/GalleryLockSystem.class at line 147 (DatabaseLockSystem::_acquireLock)
  • in modules/core/classes/helpers/GalleryLockHelper_simple.class at line 176 (GalleryLockSystem::acquireWriteLock)
  • in modules/core/classes/GalleryCoreApi.class at line 2185 (GalleryLockHelper_simple::acquireWriteLock)
  • in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 42 (GalleryCoreApi::acquireWriteLock)
  • in modules/core/classes/GalleryCoreApi.class at line 2263 (GalleryEntityHelper_medium::deleteEntityById)
  • in modules/core/ItemDelete.inc at line 79 (GalleryCoreApi::deleteEntityById)
  • in main.php at line 231 (ItemDeleteController::handleRequest)
  • in main.php at line 94
  • in main.php at line 83

System Information
Gallery version 2.2.1
PHP version 5.2.3 cgi-fcgi
Webserver Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
Database mysqli 5.0.24a-standard-log
Toolkits Thumbnail, NetPBM, Gd
Operating system Linux flower 2.4.29-grsec+w+fhs6b+gr0501+nfs+a32+++p4+sata+c4+gr2b-v6.189 #1 SMP Mon Feb 7 13:23:30 PST 2005 i686
Browser Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070601 Firefox/2.0.0.4 (Swiftfox)

Anything I can do about this?


#2

What locking are you using? I use File locking, though the admin page states that this may be unreliable on NFS systems, for some reason. But it works for me. You could try Database locking. This is set on the Admin General Settings page.

As a side note, are you using the Gallery Remote application to upload pictures? I find GR to be a pretty slick way to update my galleries.

-Scott


#3

It was set on Database - have switched to File - will see if that helps.

I FTP the pix to a temp folder and then use “import from local dir” to get them into the albums.

Gallery Remote is only for Windows and I use linux.

The whole server is real slow though, not just gallery.
I have a few wordpress blogs and they can take up to a minute to appear and 20 seconds to change pages.

Admin have shifted me to a different server but the issue is worse rather than better.

===================
Well I’ve been trying to change it from Database to File locking, but the server keeps timing out after I hit the save button… :frowning:

Error (ERROR_STORAGE_FAILURE)

  • in modules/core/classes/GalleryStorage.class at line 690 (GalleryCoreApi::error)
  • in modules/core/classes/GalleryCoreApi.class at line 2765 (GalleryStorage::updateMapEntry)
  • in modules/core/classes/helpers/GalleryPluginHelper_medium.class at line 401 (GalleryCoreApi::updateMapEntry)
  • in modules/core/classes/helpers/GalleryPluginHelper_medium.class at line 314 (GalleryPluginHelper_medium::_updateParameter)
  • in modules/core/classes/GalleryCoreApi.class at line 411 (GalleryPluginHelper_medium::setParameter)
  • in modules/core/AdminCore.inc at line 153 (GalleryCoreApi::setPluginParameter)
  • in main.php at line 231 (AdminCoreController::handleRequest)
  • in main.php at line 94
  • in main.php at line 83

#4

SSH into your server and type ‘uptime’ to check the load. If the load is crazy, then it’s no wonder things are timing out. Keep bugging Support if this is the case.

As for Gallery Remote, it is available for Linux. It’s just a Java app, so it should work on your box.

-Scott


#5

[flower]$ uptime
21:40:48 up 7 days, 8:54, 1 user, load average: 3.44, 3.79, 4.06
[flower]$
Whats a good or bad load average?

Thanks I will look at getting the GR 4linux installed


#6

That load is ok, nothing to worry.

I prefer to create a G2 upload folder on the server, then I FTP all my files to that folder and add them in Gallery using the “From local server” option. Works fine for me, even on hundreds of larger images, in fact I’m doing it as we speak.

BTW: I choose to disable the “Create thumbnails now” at the bottom of the “From local server” option. That way the thumbs are created when needed and it doesn’t put an unnecessary load on the server.

Jan

Promo-Code: [color=#CC0000]SAVEMONEY97[/color] - Save [color=#CC0000]$97[/color] on your first year of hosting.
Get more promo codes here


#7

For the original poster, as zylox said, the load’s fine. How fast is it just to view your gallery? Is Apache throwing any errors? Check your error.log for your domain.

Another option is to go into Gallery Admin and do some of the Maintenance (optimize database, delete sessions and caches, etc.)

I’ve done the “From local server” before, but that makes it a two-step process. I got into my GR habit because a) it scaled the images before uploading, so I wouldn’t have to upload a full-sized file, and b) my most-used gallery is for a bike club, so FTP isn’t an option for the other users.

I go with the Create Thumbs Now because I’d rather take the time and performance hit upon upload to save time when the page is first viewed, usually by whomever uploaded the pictures. I just like having the site run faster when it can.

-Scott


#8

The support said my user load is too high:
“I did some more investigating and it appears quite a few of your processes are being killed by procwatch. What this means that there are processes your site is using that are going over specific limits. We kill (stop) the process before they crash the server. This is causing the slowness and sometimes internal server errors you are experiencing”

Viewing the gallery is pretty slow - about 10 seconds to open an album and up to a minute for the first page of 20 thumbs to appear ( if it doesnt error ) Tr for yourself if you like www.racepics.co.nz

I get a lot of Database Errors when trying to delete files or albums. Found the error.log - its empty. Nothing in it.

Yes I always turn off the Create Thumbs box before trying to add images - it always crashes if you leave that on.

Just tried to delete an album - got this error after about 5 min waiting for it to respond:
An error has occurred.

Back to the Gallery
Error Detail -
Error (ERROR_LOCK_TIMEOUT) : /home/racepics/racepics.co.nz_g2data/locks/64318

  • in modules/core/classes/FlockLockSystem.class at line 109 (GalleryCoreApi::error)
  • in modules/core/classes/GalleryLockSystem.class at line 147 (FlockLockSystem::_acquireLock)
  • in modules/core/classes/helpers/GalleryLockHelper_simple.class at line 176 (GalleryLockSystem::acquireWriteLock)
  • in modules/core/classes/GalleryCoreApi.class at line 2185 (GalleryLockHelper_simple::acquireWriteLock)
  • in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 42 (GalleryCoreApi::acquireWriteLock)
  • in modules/core/classes/GalleryCoreApi.class at line 2263 (GalleryEntityHelper_medium::deleteEntityById)
  • in modules/core/ItemDelete.inc at line 79 (GalleryCoreApi::deleteEntityById)
  • in main.php at line 231 (ItemDeleteController::handleRequest)
  • in main.php at line 94
  • in main.php at line 83

System Information
Gallery version 2.2.1
PHP version 5.2.3 cgi-fcgi
Webserver Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
Database mysqli 5.0.24a-standard-log
Toolkits Thumbnail, NetPBM, Gd
Operating system Linux flower 2.4.29-grsec w fhs6b gr0501 nfs a32 p4 sata c4 gr2b-v6.189 #1 SMP Mon Feb 7 13:23:30 PST 2005 i686
Browser Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070601 Firefox/2.0.0.4 (Swiftfox)


#9

Some things:
Missing image: http://www.blog.racepics.co.nz/images/468x60-e.gif
Your load speed doesn’t seem excessively slow for Gallery. It’s a ton of thumbs, so that will take some time.
There’s a lot going on on your page. Try a very basic (or default) template and see if things speed up.

Granted, none of this has much to do with things erroring out. I have a vacation gallery that’s about as big that doesn’t give me any trouble. Are you running the latest versions of everything? Check your Plugins.

Look through the Apache log in your home directory’s Log folder.

Turn on Debugging in Gallery via config.php.

-Scott


#10

Thanks Scott - I dont have an apache log in my /logs dir
I will see if I can fine the debugging bit and perhaps experiment with a not-so-hacked theme :slight_smile:

thanks


#11

There’d should be some Apache access and error logs. Mine are in:
/home/ME/logs/MYDOMAIN.com/http.xxxxxx/

-Scott


#12

Thanks Scott - found lots of error log files in there.
Most are…
Premature end of script headers: /dh/cgi-system/php5.cgi
File does not exist:
mod_gzip: TRANSMIT_ERROR:32
mod_gzip: TRANSMIT_ERROR:ISMEM:104

Got another email from support, with this:

Taking a look at our porcess watcher’s logs, it is filled with hundreds
of entries such as this:
2007-10-07 12:18:10 kill 4353 racepics php5.cgi “Process
puts user over total memory limit (xx.48 used + 23.11 additional would be
over xxx.00 limit)” . Each time there is an entry like that, this would
cause a 500 error in the loading of your site. It clearly seems that your
site has a very large memory footpring, as it is typically using 15-25MB
of RAM for each page view. That is a very a large memory footprint for a
single site. Anything you can do to improve the coding to make it scale
efficiently would improve your sites loading drastically. Another option
would be to move to a private server where there wouldn’t be any memory
limits , so your sites would have access to the RAM that they crave. You
can learn more about our private server offerings here:
https://panel.dreamhost.com/?tree=vserver.provision

I’ve switched from matrix template to classic and it seems slightly faster.
Have also done a few of those bits in the Gallery Maintenance section although database cache clearing fails every time.

I’ve been told also that putting websites under different usernames will also help.

Gallery version = 2.2.1 core 1.2.0.1
PHP version = 5.2.3 cgi-fcgi
Webserver = Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
Database = mysqli 5.0.24a-standard-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, Ffmpeg, NetPBM, Gd, Thumbnail, LinkItemToolkit
Acceleration = none/900, none/900
Operating system = Linux flower 2.4.29-grsec+w+fhs6b+gr0501+nfs+a32+++p4+sata+c4+gr2b-v6.189 #1 SMP Mon Feb 7 13:23:30 PST 2005 i686
Default theme = classic
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070601 Firefox/2.0.0.4 (Swiftfox)
Rows in GalleryAccessMap table = 35
Rows in GalleryAccessSubscriberMap table = 24084
Rows in GalleryUser table = 2
Rows in GalleryItem table = 24069
Rows in GalleryAlbumItem table = 112
Rows in GalleryCacheMap table = 6681


#13

You could do some experimenting by deactivating a bunch of plugins. I don’t run too many plugins just because I don’t like most of what they offer.

-Scott


#14

You might want to make sure you are indexing you larger tables:

Rows in GalleryAccessSubscriberMap table = 24084
Rows in GalleryItem table = 24069

–rlparker


#15

ok deactivated unwanted plugins

how does one “index my tables” ?
No idea what that is sorry…


#16

There’s no reason to apologize; we all learn something everyday (assuming we are paying attention, that is)! :wink:

There’s a pretty good introduction to the subject of optimizing MySQL applications available on SitePoint, and it includes an explanation of indexing tables and describes why indexing tables help.

Another great resource is a Tech Republic piece on “Three Easy Ways to Optimize Your MySQL Queries”.

Google also gives you a lot of other references for this subject.

–rlparker


#17

whoa - that was several metres over my head :slight_smile:
From what I understood of it, [which is probably very little] indexing is there to [speed up] and sort out the searching of random data [random-photo-name.jpg] ?
All of my images are numbered sequentially rather than named, so I dont know if indexing would gain anything in my situation. The database should find sequential numbering pretty easy to follow.
Maybe the problem is the sheer size ( 20,000 images )

I dont know how to, nor would I want to, hack around with my database - if I screwed it up I would need to reinstall Gallery and re-upload 20,000 images?

The thought makes me feel ill. LOL

I could try splitting the gallery up into several smaller ones.

Thanks everyone for the hints.
chris


#18

I wonder if a poorly optimized database will cause the problems you’re experiencing. I’d expect the load to hit the database server, and not your website server, which is what seems to be happening.

Will a slow database cause Gallery to hog up memory?

-Scott


#19

Interesting you should ask that… I have mostly database driven sites in my account, they are Gallery and Wordpress - all are painfully slow.
I also have a few plain html sites - they are 10x as fast.
It would seem the performance/overload issues are due to the website having to access a database.

The sites are also faster/slower at certain times of the day. Here in New Zealand we are 12hrs ahead of the server time. So at mid day here ( midnight over there ) the speed is not as bad as say 8am here ( busy time over there )

I would shift it all to a New Zealand based host but there are no deals like Dreamhost over here. The best I can get here is 3gb of space for $45 per month.