0
Welcome Guest! Login
0 items Join Now

Gantry and Cpu load

  • Gantry and Cpu load

    Posted 10 years 4 months ago
    • Hi,
      I had many problems with CPU load with Gantry 4. My site for 2-3 or more minutes was very slow. Load avarage had peaks of 20-40! (top command).

      After many tweaks I found that Less compiler making intensive operation for my server with 2 core of CPU and 5 Gb of Ram.

      If someone have same problem, can disable Gantry's LESS compiler in the file /libraries/gantry/core/gantry.class.php by simply commenting out lines 1088 - 1106;
      $runcompile    = false;
      $cache_handler = GantryCache::getCache($cachegroup, null, true);
       
      $cached_less_compile = $cache_handler->get($cssfile_md5, false);
      if ($cached_less_compile === false || !file_exists($css_file_path)) {
          $cached_less_compile = $less_file_path;
          $runcompile          = true;
      } elseif (is_array($cached_less_compile) && isset($cached_less_compile['root'])) {
          if (isset($cached_less_compile['files']) and is_array($cached_less_compile['files'])) {
              foreach ($cached_less_compile['files'] as $fname => $ftime) {
                  if (!file_exists($fname) or filemtime($fname) > $ftime) {
                      // One of the files we knew about previously has changed
                      // so we should look at our incoming root again.
                      $runcompile = true;
                      break;
                  }
              }
          }
      }
       

      After this operation My CPU is now discharge See the image below: (after h 18!!)

      Is there another persistent method to disabling less compiler? Maybe next version of Gantry should implement this option...

      Thank you
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: Gantry and Cpu load

    Posted 10 years 4 months ago
    • Less compiler is active ONLY if you change something in the LESS files or template configuration so when you are finished with template customizations, this shouldn't be active at all
    • Check my services at: Mihha-Vision
  • Re: Gantry and Cpu load

    Posted 10 years 4 months ago
    • Igor Mihaljko wrote:
      Less compiler is active ONLY if you change something in the LESS files or template configuration so when you are finished with template customizations, this shouldn't be active at all

      In fact, it is true, so it should be! But I didn't made any changes and Cpu load was always high peaks. From Yestarday the Cpu and server avarage was drammatically reduced!

      It's very strange... maybe that with some server configuration the Less compiler is always Active. Accordingly, maybe, adding the activation of a new feature with 2 mode (developing and productions website) selectable from user, many problems and server load will be solved!
  • Re: Gantry and Cpu load

    Posted 10 years 4 months ago
    • Update from my server CPU load!

Time to create page: 0.054 seconds