• 0

Compiled CSS CPU Usage


Question

Posted · Report post

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.

Share this post


Link to post
Share on other sites

5 answers to this question

  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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 
    add_filter( 'render_css_posix_', '__return_true' );
     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: http://forum.pagelines.com/topic/24148-pagelines-compiled-css-slow-load-time/
  • 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: 
    define( 'LESS_FILE_MODE', true );
    

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

     

     

     

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now