Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
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:
- Faster rendering.
- No database calls or PHP reliance.
- Respects the caching rules set by your server config.
- Easier to make quick edits.
Offline
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
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
Re: css.php memory problems
^^ that’s what rvm_css does for you automatically ;)
Offline
Re: css.php memory problems
Thanks Ruud, I’ve downloaded it and will press it into action on the troublesome sites.
Offline
Pages: 1