You are not logged in.
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.
Offline
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
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
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.
Offline
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
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
Whoa – go for it Bert. :)
Stuart – The Bombsite – ProText Themes – Textgarden
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Oh, lord! At last!
I have been praying for this. I really have.
Offline