Textpattern Forum

You are not logged in. Register | Login | Help

#31 2008-01-06 18:01:17

hcgtv
Member
From: Charlotte, NC
Registered: 2005-11-29
Posts: 2,154
Website

Re: rvm_css (v1.0)

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.


txp:tag – Textpattern Tags ~ TxPlanet – Textpattern Planet

Offline

#32 2008-01-06 18:12:07

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: rvm_css (v1.0)

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

#33 2008-01-06 18:59:13

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 4,492
Website

Re: rvm_css (v1.0)

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

#34 2008-01-06 22:53:49

hcgtv
Member
From: Charlotte, NC
Registered: 2005-11-29
Posts: 2,154
Website

Re: rvm_css (v1.0)

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.


txp:tag – Textpattern Tags ~ TxPlanet – Textpattern Planet

Offline

#35 2008-01-06 23:13:31

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 4,492
Website

Re: rvm_css (v1.0)

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

#36 2008-01-06 23:37:39

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: rvm_css (v1.0)

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

#37 2008-01-06 23:49:15

hcgtv
Member
From: Charlotte, NC
Registered: 2005-11-29
Posts: 2,154
Website

Re: rvm_css (v1.0)

ruud, thanks.

steve, yes, and you’ll also have revisions of your pages and forms.


txp:tag – Textpattern Tags ~ TxPlanet – Textpattern Planet

Offline

#38 2008-01-06 23:59:31

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: rvm_css (v1.0)

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

#39 2008-01-07 00:21:15

thebombsite
Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: rvm_css (v1.0)

Whoa – go for it Bert. :)


Stuart – The BombsiteProText ThemesTextgarden

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.0)

Oh, lord! At last!

I have been praying for this. I really have.

Offline

Board footer

Powered by FluxBB