Jump to content


Photo
- - - - -

Compiled CSS CPU Usage

performance compiled css cpu

  • Please log in to reply
5 replies to this topic

#1 yu4daas

yu4daas

    Newbie

  • Members
  • 1 posts
  • Country: Country Flag

Posted 04 April 2013 - 05:07 PM

Hello.

 

We are having a serious performance issue with our server when rendering the following resource:

 

/wp-content/themes/pagelines/pagelines-compiled-css-[random number]

 

All other resources are server in milliseconds but these "dynamic CSS" is rendered in every request, which takes around 2-3 seconds of nearly 100% CPU, which makes all our caching efforts useless, reducing the performance of our instances to nearly 2 ridiculous request per second while we are reaching over 1000rps in every single content except for this one.

 

Site info:

 

URL: www.appgree.com

Pagelines version: 2.4

Web server: Nginx 1.2.6

PHP Backend: PHP-FPM 5.3.20

Wordpress Plugins:  

  • WP-FFPC 0.6.1 (Currently caching is disabled for debugging purposes)
  • Pagelines Sections 1.0
  • Contact Form 7 3.3.3
  • Block Bad Queries 20130103

 

The only caching system we are currently using are browser caching and full page caching in a memcached backend. 

 

Investigating in the forum, we have tried setting the wp-config.php variable LESS_FILE_MODE to enable the "static" behaviour of the CSS but doesn't affect in any way the behaviour of the application.

 

Right now we have been able to workaround this in an internal environment by saving the CSS contents in a static file and setting a rewrite rule in Nginx to serve the file instead of any resources matching the query string mentioned above which we think is a too dirty approach to deploy it in production.

 

Are there any further settings we should try to disable this "dynamic CSS" behaviour?

 

Regards.



#2 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 04 April 2013 - 05:16 PM

Sure, this gets asked every day.

 

1st read this:

Please Login or Register to see this Hidden Content

 

Then read yesterdays post:

Please Login or Register to see this Hidden Content



#3 mtaus

mtaus

    Super Member

  • Members

  • 132 posts
  • Country: Country Flag

Posted 14 September 2013 - 05:29 PM

The links above are broken. I've been searching the forums, but I cannot find a definitive answer to this issue. It would probably be a good idea to add something current to docs.pagelines.com.



#4 mtaus

mtaus

    Super Member

  • Members

  • 132 posts
  • Country: Country Flag

Posted 14 September 2013 - 06:14 PM

I was able to resolve this. So for the sake of others that start searching these forums to resolve this, here's what I did:

 

  • Make sure that PHP Posix extensions are installed by adding 

    Please Login or Register to see this Hidden Content

     to functions.php in your child theme. If you're using the base PageLines theme you'll find this file in /wp-content/themes/dms/ ...  More info:

    Please Login or Register to see this Hidden Content

  • It's not clear from the forum comments whether this next step is still necessary (or whether it is now included as a default setting), but I also add the following to my wp-config.php: 

    Please Login or Register to see this Hidden Content

    which forces Pagelines to write the CSS/LESS file and cache it, rather than dynamically generate it for every user request.

     

     

     


  • Danny likes this

#5 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 15 September 2013 - 04:00 PM

Hi,

 

Please Login or Register to see this Hidden Content

and

Please Login or Register to see this Hidden Content

are the links Simon intended to provide. The URL for the forum was modified.



#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 15 September 2013 - 04:06 PM

@yu4daas  I've looked at your site's pingdom.com report.

 

Your site takes 627milliseconds to load the domain, prior to PageLines loading.  Then, to load the /en folder, it requires 401milliseconds wait time.  Combined, these two, including overlap, bring the initial load time very close to 1 full second, before WordPress or PageLines Framework begin to load.

 

From that point forward, all your content, WP and Framework, images, ads (if any), CSS, etc take an additional 82 seconds to load for a grand total of 1.81 seconds.

 

That's excellent speed.