We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    I posted a similar question a few weeks ago, but now have a better idea what's going on.

    The site I'm working on has about 700 images in the images folder. When inserting an image for example in an image TV, it can take a very long time (about 1,5 minutes) to see all of the image thumbnails in the browser. Analyzing this with the Google Chrome inspector, I see all of the thumbnails are loaded, one after another (in total there are about 700 requests being made, with a total of 2 MB). This takes about 1,5 minutes, and it blocks everything else, the thumbnail doesn't show for the image TV until they have all loaded (even after closing the browser window), saving the document hangs and even the frontend is not loaded until after all thumbs have loaded in the manager.

    If I open the browser another time shortly after, all the thumbs are shown immediately, and only the ones I select are requested, and everything is fast. But if I try a few minutes later everything is gone and all the requests are made again.

    I read that phpthumb makes a new connection for each thumb it requests. Can I change this somehow? Or is it a server problem that it takes 1,5 minutes to process 700 requests (or is this normal?). Or would it be possible to cache the images for a much longer time in the modx browser?

    I don't get any errors in the error log and I'm on:

    MODX Revolution 2.1.3-pl (traditional).
    PHP: 5.3.8
    MYSQL database version: 5.0.92
    ExtJS: 3.4.0
    Apache 2.0
    (please let me know if you need to know something else.)

    The images in the file browser have this url:
    http://mywebsite.com/connectors/system/phpthumb.php?src=images%2Fimage.jpg&w=80&h=60&f=jpg&q=90&HTTP_MODAUTH
    =modx4eb008ae0e4ab3.85382980_14f0c50d65c4072.74025567&wctx=
    web&basePath=content%2F&basePathRelative=1&baseUrl=content%2F&baseUrlRelative=1

    Is this correct? Shouldn't this be the link to the cached file in core/cache/phpthumb?

    Anyone recognize this or have an idea what could be the problem?

    Thanks for any help!

    [ed. note: michelle84 last edited this post 14 years, 8 months ago.]
      • 19328
      • 433 Posts
      Hi guys,

      I found out that the server processor could not handle all the phpthumb requests and thus get clogged. I upgraded my server environment (more RAM and CPU) and now everything is working faster. Not lightning fast, but it is reduced to half the time.

      My hosting partner also made a cache folder outside the document root which is running directly from the RAM (or something like that, as my hosting partner told me. I'm not a server pro wink). (If you do the same, don't forget to change the cache folder in core/model/phpthumb/modphpthumb.class.php: $cachePath)

      When I'll find something more to speed the phpthumb processing up, I'll let you all know.

      (Note; it's not wise to put 700 images in one folder, but in my situation it was the only way to go.)

      Regards
      Michelle [ed. note: michelle84 last edited this post 14 years, 8 months ago.]
        • 3109 ☆ A M B ☆
        • 894 Posts
        Any site using phpthumb will have a bit of performance issues since the server needs to process the images on the fly what you can do to speed up a bit is make sure your phpthumbof call is cached that way it will only process the images once.

        700 images is a bit overkill IMHO maybe you should reconsider doing some sort of pagination for each 50 images or something like that sort of how like some stock image sites do, they do it for a reason.

        Good luck.
          Benjamin Marte
          Interactive Media Developer
          Follow Me on Twitter | Visit my site | Learn MODX
          • 19328
          • 433 Posts
          @benmarte The 700 images which are loaded and clog up the website are the ones loaded in the back-end of MODX, (in the MODX Browser), not on the front-end.

          It would indeed be a better idea to use pagination if these were loaded on the front-end, and I should split up the images in folders for use on the back-end. Unfortunately that was not possible due a content migration of +500 pages from an old site to MODX...
            • 3109 ☆ A M B ☆
            • 894 Posts
            @michelle Oh ok I misunderstood what you wrote then, but yeah the best option would be to move them to folders with a smaller amount if possible.

            Let us know if you find a solution other than further upgrading your server environment.

            Good luck.
              Benjamin Marte
              Interactive Media Developer
              Follow Me on Twitter | Visit my site | Learn MODX
              • 8921
              • 55 Posts
              Any resolution to this issue? I have a site on a fast dedicated server with a couple hundred photos. Any time I open the image browser either from the files tab or the RTE, it basically spikes the load on my server way up and brings the site to it's knees. There is something definitely wrong with what phpthumb is doing in the image browser. It spawns off 10+ processes all trying to grab 25% of the CPU.

              Is there any way to turn phpthumb off for the manager file browser? Or have it so that it's actually using it's cache? It seems to create the cache files, but never actually uses them. it re-generates the files every time the image browser is opened.
                • 40045
                • 534 Posts
                Would also be very interested in how to make phpthumb in the backend not killing my server every time an editor is using the filebrowser...this is a desaster^^...using the cached thumbnails would be a good start^^...but also these would probably get requested and make some serious impact when viewing folders with several hunderd images...
                  • 36933
                  • 35 Posts
                  Has a solution to this problem been found. I am trying out Revo for the first time, coming from Evo and this slowness is actually making me rethink my decision.

                  I look look in the image folder on the server and there are actually no thumbnails being created and stored so I am assuming Revo is doing it all on the fly. I only have 50 odd images in the folder and to have to sit there and watch them slowly fill in the thumbnails one at a time is painful. Although maybe my issue is not bound to the image/resource browser as the left hand trees also have to think a little bit before loading.

                  Is there anything in general that could be wrong here?
                    • 3109 ☆ A M B ☆
                    • 894 Posts
                    @bradelaide No, that's just how slow Revo is thanks to ExtJS.
                      Benjamin Marte
                      Interactive Media Developer
                      Follow Me on Twitter | Visit my site | Learn MODX
                      • 36933
                      • 35 Posts
                      Wow, that is really disappointing, i was looking forward to sinking my teeth into Revo but I can't put up with this sort of lag when I know I can install Evo and have no issues.

                      Thanks