Album editing performance - virtually unusable

I have a zenphoto installation with a massive image archive. I have subdivided my images into a hierarchy of albums and with the current version (1.4.5.9) album viewing performance is great!

However, it is nearly impossible for me to edit albums. Currently it is taking longer than 5 minutes for the edit album page to show up, It's long enough that the proxy on my firewall typically decides that the server isn't responding and drops the connection. In order to edit an album I either have to be on my home network or forward a port via. ssh to bypass my proxy.

If I trace the php-fpm server I see that it is calling stat() on every single image in my entire gallery, not just the images in the current album I am editing. Do you have any idea why this is happening and how I might be able to stop it?

I'm running zenphoto behind nginx and php-fpm. For the most part this is working wonderfully, it's just the album editing and some of the admin functions that are painfully slow.

Comments

  • acrylian Administrator, Developer
    Please take a look here for measures to take:
    http://www.zenphoto.org/news/problems-with-albums-and-images#the-albums-on-the-back-andor-backend-are-slow
    You might use the table of content menu on the top right as the anchor link does not work in certain browsers.
  • acrylian,

    Please read my whole post -- the problem isn't with albums it's with editing. I see the php process calling stat() on *every* image in my entire gallery when I edit an album, not just images in that album.

    Honestly, I think it's either a bug or it has something to do with the iterating of tags. But it's odd that it is only calling stat(), I don't see it opening any of the image files.
  • acrylian Administrator, Developer
    I have never heard about the stats() issue before - zenphoto.org runs on nginx as well. So where exactly do you get the issue? On editing an album, editing the images or sorting albums or images? What are the settings of images per page etc.

    I would also suggest to try the 1.4.6 beta.
  • I'm seeing the issue editing any album in my gallery. If I select "Edit album" from the Admin toolbox my browser will just spin for 5+ minutes (it was about 6 1/2 the last time I timed it). If I ssh into the server and strace the php-fpm process I see it looping through my entire gallery, calling access() for each folder then stat() for each image in each folder.

    There is nothing unusual showing up in any of the logs, not even the debug log is getting any data.

    The image number settings don't affect anything, neither does the theme. I'm seeing it happen with every album in the gallery as well.
  • acrylian Administrator, Developer
    From the link above:
    Disable the option "gallery > visual thumb selection" and "gallery > subalbum thumb selection". Both are normally off by default.

    Otherwise it will indeed process all images to generate the thumbnails for that selector.

    Also please read here how caching works on Zenphoto.
    http://www.zenphoto.org/news/caching
  • Those are already selected, and the thumbnails have been long-since generated for most of my gallery content.

    Let me give an example. Let's say I have 4 albums, album1, album2, album3, album4. I go to my gallery main page which loads quickly. I then pick album1 and I see all of my album1 sub galleries and images displayed. If I select "edit album" at this point from the admin toolbox, I can go out for coffee (and maybe lunch) before the album edit page is displayed.

    It will take upwards of 5 minutes to display the edit album page. If I look at the system I'll see the php-fpm process in top. If i strace that process I see it calling stat() for every file in every album, not just album1 and its sub albums. It will call stat() on every image in album1, then every image in album2, then album3 and so on. Since it's being called from php stat() won't tell me where this is being done, but it really looks like a bug that the system is trying to inspect every single image in the entire gallery whenever I edit any album.
  • acrylian Administrator, Developer
    Of course Zenphoto is file system based so it matches the file system with the database. But on the normal album edit page (http://www.zenphoto.org/screenshots/zenphoto-admin/album-edit.jpg.html) it does only if the selector is enabled. On the images sorting tab (http://www.zenphoto.org/screenshots/zenphoto-admin/album-image-sorting.jpg.html) it of course does this. Also it counts images if you display the full tree on the main albums tab (http://www.zenphoto.org/screenshots/zenphoto-admin/albums-with-sublevel-display.jpg.html).

    If that all does not help you should open a ticket and post the extact and complete info from the system log there, too. Also a link to your site would probably help, just to see the size of the site.
Sign In or Register to comment.