Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: rvm_css (v1.2)
ruud wrote:
Bert, try benchmarking the difference between loading css.php and the static stylesheet.css file instead.
Let’s welcome JoeDog’s siege to the proceedings.
urls-cssphp.txt:
http://txpage.com/about/
http://txpage.com/textpattern/css.php?s=about
http://txpage.com/textpattern/txp_img/carver.gif
http://txpage.com/images/1.gif
siege -d1 -r10 -c25 -f /home/bert/urls-cssphp.txt
Transactions: 250 hits
Availability: 100.00 %
Elapsed time: 7.22 secs
Data transferred: 0.48 MB
Response time: 0.08 secs
Transaction rate: 34.63 trans/sec
Throughput: 0.07 MB/sec
Concurrency: 2.84
Successful transactions: 250
Failed transactions: 0
Longest transaction: 0.92
Shortest transaction: 0.00
urls-static.txt:
http://txpage.com/about/
http://txpage.com/_templates/default.css
http://txpage.com/textpattern/txp_img/carver.gif
http://txpage.com/images/1.gif
siege -d1 -r10 -c25 -f /home/bert/urls-static.txt
Transactions: 250 hits
Availability: 100.00 %
Elapsed time: 7.86 secs
Data transferred: 0.48 MB
Response time: 0.02 secs
Transaction rate: 31.81 trans/sec
Throughput: 0.06 MB/sec
Concurrency: 0.75
Successful transactions: 250
Failed transactions: 0
Longest transaction: 0.19
Shortest transaction: 0.00
The APC cached css.php wins against the static css file, go figure.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: rvm_css (v1.2)
I did the same thing but compared as rudd suggested:
My css file is 28k big.
Without:
Concurrency Level: 5
Time taken for tests: 12.173134 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 2894400 bytes
HTML transferred: 2880400 bytes
Requests per second: 8.21 1 (mean)
Time per request: 608.657 [ms] (mean)
Time per request: 121.731 [ms] (mean, across all concurrent requests)
Transfer rate: 232.15 [Kbytes/sec] received
With:
Concurrency Level: 5
Time taken for tests: 2.338252 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 2904100 bytes
HTML transferred: 2880400 bytes
Requests per second: 42.77 1 (mean)
Time per request: 116.913 [ms] (mean)
Time per request: 23.383 [ms] (mean, across all concurrent requests)
Transfer rate: 1212.87 [Kbytes/sec] received
This plugin is awesome! What else might be speeded up using this method? Would it make sense to have static pages and forms as well?
Last edited by typeshige (2008-01-06 18:13:39)
Offline
Re: rvm_css (v1.2)
This is what I get, with a CSS file that’s 2.4kB
without: ab -c 5 -n 250 http://path/to/css.php
Requests per second: 10.46 1 (mean)
with: ab -c 5 -n 10000 http://path/to/static.css
Requests per second: 1026.68 1 (mean)
I used 10000 on the second one so the tests ran an near equal amount of time (otherwise the second test would be too inaccurate). This was tested by using “ab” on the same server that hosted the website to exclude network latencies and throughput issues.
Bert, I think you’re not measuring APC speed, but some kind of connection limitation on the webserver that hosts your website or simply the latency or throughput fluctuation between your webhost and the server where you’re running “ab” or “siege”.
typeshige, you can’t use this to speed up forms/pages in TXP, because those are combined with article data that is pulled from the database to form the website page that is sent to the visitor. The technique to speed up css files here really only works for page elements (as requested by the browser!) that can be stored entirely as a static file.
Offline
Re: rvm_css (v1.2)
ruud wrote:
Bert, I think you’re not measuring APC speed, but some kind of connection limitation on the webserver that hosts your website or simply the latency or throughput fluctuation between your webhost and the server where you’re running “ab” or “siege”.
The tests were run on the same machine that runs the websites.
All I know is that with APC, the amount of requests my web server can handle was multiplied by a factor of 5. Which I think is what brings a site using css.php on par with a statically linked css file, at least that’s what all my tests have shown.
On a side note, the way you save off the CSS to a file could be extended to pages and forms. If you don’t mind, may I use some of your logic and add it to my templates plugin? I want to make the directory where the templates are stored an admin preference and I’d like to have archive capabilities with timestamped files, for backup purposes.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: rvm_css (v1.2)
Bert, my plugins are released under GPLv2 or later license. Within the limits of that license, you’re free to re-use my code ;)
Offline
Re: rvm_css (v1.2)
hcgtv wrote:
On a side note, the way you save off the CSS to a file could be extended to pages and forms. If you don’t mind, may I use some of your logic and add it to my templates plugin? I want to make the directory where the templates are stored an admin preference and I’d like to have archive capabilities with timestamped files, for backup purposes.
do you mean we could have ‘revisions’ of say..a css stylesheet?
for example in typolight CMS, whenever you save a stylesheet, a revision is made so you can easily revert a change:

Last edited by iblastoff (2008-01-06 23:43:01)
Offline
Re: rvm_css (v1.2)
ruud, thanks.
steve, yes, and you’ll also have revisions of your pages and forms.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: rvm_css (v1.2)
hcgtv wrote:
steve, yes, and you’ll also have revisions of your pages and forms.
bert that would be beautious!!!
Last edited by iblastoff (2008-01-06 23:59:46)
Offline
Re: rvm_css (v1.2)
Whoa – go for it Bert. :)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#40 2008-01-12 04:26:07
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: rvm_css (v1.2)
Oh, lord! At last!
I have been praying for this. I really have.
Offline
#41 2008-01-12 11:09:41
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: rvm_css (v1.2)
hcgtv wrote:
steve, yes, and you’ll also have revisions of your pages and forms.
Woo! Let me know when it’s released. I’ve really been longing for this feature.
Last edited by FireFusion (2008-01-12 11:10:04)
Offline
Re: rvm_css (v1.2)
Impressive stuff, Ruud – thank you.
If you were considering a future feature – one might be an option on the CSS edit window, next to “save”, to strip out comments and whitespace in the static version (but it still remains annotated in the editable version).
The reason I think it would need to be an option is that I’ve seen otherwise well-behaved stylesheets with maybe just a missing semi-colon suddenly break when stripping out comments and whitespace.
~Nick
Offline
Re: rvm_css (v1.2)
I’ve implemented this in all the txp based sites. This really speeds up things! Neat job!
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
Re: rvm_css (v1.2)
This plugin seems to be a great complement to asy_jpcache. Do you all use that one too? Thanks a lot Ruud!
Offline
#45 2008-02-01 01:12:08
- candyman
- Member

- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: rvm_css (v1.2)
I have a problem with, I think, file permission.
The directory is created (at the same level of images one), named lovercase css and the path is correct (in advanced preferences I have this: Style directory: css).
Anyway, even if I choose a style file and save, nothing appears in the css directory.
What should I control?
Thnks in advance.
EDIT: solved
Last edited by candyman (2008-02-01 08:28:59)
Offline