Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-05-10 11:23:37

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

css.php memory problems

Hi,

I have two TXP websites hosted on a CloudLinux server and there have been a lot of problems with pages not rendering properly. Nothing had really changed in the coding of the sites so I contacted the hosting company and they have pinpointed the problem to css.php. Apparently the script tried to allocate more than 2GB when the limit is 1GB.

I’ve done a trace tag on one of the sites and got the following:
<!-- Runtime: 0.0439 -->
<!-- Query time: 0.017901 -->
<!-- Queries: 56 -->
<!-- Memory: 5131Kb, end of textpattern() -->

The site is very simple although it does use four stylesheets (reset, 960 framework, screen and print). I’ve done some searching in the forum but not found a lot of information although maybe something like rvm_css might help.

At the moment I’m caught between client and hosting company so any advice would be greatly appreciated!

Offline

#2 2012-05-10 12:54:04

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: css.php memory problems

Not really a fix to your PHP issue exactly, but why not serve your CSS as flat files instead of storing them in the database? Unless you have no FTP access to your hosting I can find no compelling reason at all to store CSS in Textpattern’s database.

Some of the advantages of serving flat CSS files:

  1. Faster rendering.
  2. No database calls or PHP reliance.
  3. Respects the caching rules set by your server config.
  4. Easier to make quick edits.

Offline

#3 2012-05-10 13:08:59

spiffin
Plugin Author
From: London, UK
Registered: 2004-06-08
Posts: 95
Website

Re: css.php memory problems

decoderltd wrote:

..maybe something like rvm_css might help.

rvm_css will definitely help .. for exactly the reasons Phil mentions.

Offline

#4 2012-05-10 14:45:07

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: css.php memory problems

Thanks for your advice Simon and Phil.

It looks like storing the CSS stylesheets in the database is not the best way to go, I’ll create static versions instead and hopefully that will solve the problem.

Offline

#5 2012-05-10 16:02:43

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: css.php memory problems

^^ that’s what rvm_css does for you automatically ;)

Offline

#6 2012-05-10 21:53:25

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: css.php memory problems

Thanks Ruud, I’ve downloaded it and will press it into action on the troublesome sites.

Offline

Board footer

Powered by FluxBB