Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2005-05-17 23:05:16

edburdo
Member
Registered: 2004-09-20
Posts: 79
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

I am on a shared short atm… so I can’t pull those values. I do know it appears quicker, and when I run it through some benchmark tests (like sitereportcard.com) it loads faster than it did.

Many Kudo’s. Now I just need to upgrade the other installs to RC3, and start making use of this (and other) plugins and features. :P


Eric

Offline

#14 2005-05-17 23:52:40

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

> jbrew wrote:
> The Admin-plugin is all screwy and wont install… anyone have a version that will?

You are right, I overlooked your comment or I would have answered earlier. I have now repackaged 0.7 as 0.7.1. The admin-side plugin should now be installable. I must have made an error while copying and packaging the files.

Offline

#15 2005-05-18 06:13:44

jason
Member
From: USA
Registered: 2004-02-23
Posts: 85
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

OK, I dropped it in, added the line.

Client and server are both Dell 2850s, 6GB RAM, Dual 3.6Ghz, 3+2 split RAID 5/RAID1, MySQL 4.11, PHP 5.04 with eaccelerator.

Also it’s lighttpd 1.3.13 with PHP-FastCGI and only 4 PHPs running.

Server Software: lighttpd/1.3.13
Server Hostname: jasonhoffman.org
Server Port: 80

Document Path: /
Document Length: 3844 bytes

Concurrency Level: 100
Time taken for tests: 28.1457 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 4068000 bytes
HTML transferred: 3844000 bytes
Requests per second: 35.71 1 (mean)
Time per request: 2800.146 [ms] (mean)
Time per request: 28.001 [ms] (mean, across all concurrent requests)

Installed it. Hit the front page, two sections and the feed. I see

gilford# ls -l jpcache/cache/
total 10
rw-rw-rw 1 jah jah 1099 May 18 06:03 jpc_335ea3181153fd6dce0d65414d51da01
rw-rw-rw 1 jah jah 1016 May 18 06:02 jpc_3c0ee9eecc2f28be3b2df87abcaaba9e
rw-rw-rw 1 jah jah 1878 May 18 05:59 jpc_82bb5fd25d2ee63bb7b1241525d5df33
rw-rw-rw 1 jah jah 1340 May 18 06:02 jpc_93ca02f1504cc7b018a181ab5dbfae4d
rw-rw-rw 1 jah jah 1340 May 18 06:02 jpc_bf84b308b1428b752e2a789852f5c51b

Nice. Nice.

Let’s hit again (don’t do -c 100 at home …).

Server Software: lighttpd/1.3.13
Server Hostname: jasonhoffman.org
Server Port: 80

Document Path: /
Document Length: 3844 bytes

Concurrency Level: 100
Time taken for tests: 2.277665 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 4141156 bytes
HTML transferred: 3854298 bytes
Requests per second: 439.05 1 (mean)

HOLY SHIT! HOLY SHIT! I MEAN REALLY HOLY HOLY SHIT! I wasn’t expecting that at all.

Let’s do more.

Finished 10000 requests

Server Software: lighttpd/1.3.13
Server Hostname: jasonhoffman.org
Server Port: 80

Document Path: /
Document Length: 3844 bytes

Concurrency Level: 100
Time taken for tests: 21.154597 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 41308260 bytes
HTML transferred: 38447688 bytes
Requests per second: 472.71 1 (mean)

Oh my.

Finished 50000 requests

Server Software: lighttpd/1.3.13
Server Hostname: jasonhoffman.org
Server Port: 80

Document Path: /
Document Length: 3844 bytes

Concurrency Level: 100
Time taken for tests: 105.667725 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 206512390 bytes
HTML transferred: 192211532 bytes
Requests per second: 473.18 1 (mean)

Wow. OK. Well. Geez. I … ah … think I’m installing this everywhere I have my hands on a textpattern install …

And the site was completely “clickable” the entire time while the server did a load < 1. That’s a pretty good output, considering that would be about 40 million hits a day sustained.

Offline

#16 2005-05-18 06:26:32

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,691
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Jason, you’re quite convincing :-)


Where is that emoji for a solar powered submarine when you need it ?

Offline

#17 2005-05-18 06:28:25

jason
Member
From: USA
Registered: 2004-02-23
Posts: 85
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

The textdrive weblog is on a single proc (3something):

Requests per second: 327.68 1 (mean)

Not bad, not bad.

Offline

#18 2005-05-18 14:38:24

edburdo
Member
Registered: 2004-09-20
Posts: 79
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Sencer: Thanx for the update. And for the plugin.

Jason: Thanx for the stats. I think I will be putting this on other sites as well. Oh yeah…


Eric

Offline

#19 2005-05-18 20:11:21

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Updated to version 0.8

  • - don’t clean cache when merely viewing or previewing articles in article-event
  • - add statistic in admin-side plugin over number and total size of the cache-files
  • - sniff content and guess Content-Type on PHP4 (see Known Issues in first post)
  • - finally, completely fix garbled feeds. (strncmp returns 0 for a match, go figure…)

The last should be the most important reason to update, because from time to time you might get a broken feed with the last version.

Offline

#20 2005-05-18 22:42:42

jason
Member
From: USA
Registered: 2004-02-23
Posts: 85
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

I’m upgraded!! Thanks Sencer.

Offline

#21 2005-05-19 02:22:12

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Thanks for tweaking this, Sencer. For some reason I can’t tell if this is working on one of my textdrive accounts, any hints on testing to make sure it is active?

Offline

#22 2005-05-19 03:36:09

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Soulship: You can examine your response headers to see if X-Cache: asy_jpcache v2 – file is returned. You may use an online tool such as this one.

Offline

#23 2005-05-19 06:17:04

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,691
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

From the bottom of the help file

//Content-Sniffing to set correct Content-Type, because headers were not available

With version 0.8, I have a small problem with those headers.

I’m serving application/xhtml+xml for modern browsers via my plugin. This sets the headers (and gzip compressing) correctly.
Once asy_jpcache is activated, it overrides any header that the plugin sends, and serves everything as text/html (I haven’t checked the feeds yet).

  • I’ve disabled gzip in jpcache-config.php, no problems with that.
  • The mime type header proves harder to deal with. commenting out all those lines after the comment quoted above doesn’t help.

What actually happens is this: when the page is first requested, I get an error (and a blank page) – xml error in Firefox 1.0+, Safari returns this: ‘The error was: “bad server response


Where is that emoji for a solar powered submarine when you need it ?

Offline

#24 2005-05-19 07:40:21

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: asy_jpcache 0.9.8 - Fast Full Page Caching

Hi phiw13,

I think I understand why the things are happening that are happening. I am just not sure wether there is a best way to handle them.
My proposal may seem a bit “intrusive”, but maybe someone else can come up with a better idea:

1) IMHO you should deactivate your plugin, and let jpcache handle the compression. Reason: For ob_gzhandler (or any gzip compression) to work, you have to send the correct header. If you turn off gzip in jpcache those headers are not being sent. And there is actually a “hack” in jpcache to uncompress compressed content before dealing with it, because the default textpattern gzips feeds, but not regular pages. Turning off gzip in asy_jpcache makes (IMHO) only sense, when you use mod_gzip/mod_deflate in Apache, or zlib.output_compression in php.ini.

2) Change the saved default header in file.php on line 104 (after the //Content-Sniffing…)
Find:
<notextile><pre> else $cachedata[“jpcachedata_type”] = ‘text/html; charset=utf-8’;
</pre></notextile>
change into:
<notextile><pre> else $cachedata[“jpcachedata_type”] = ‘application/xhtml+xml;charset=utf-8’;
</pre></notextile>

I think that should work. Reason: The first two “ifs” before that check for feeds, if they are not then this content-header gets saved and will later be served. If you comment those lines out, PHP will just send whatever default Content-Type is set in php.ini.

- The other solution would be to switch to a host that has PHP5, which I know is probably not an option in most cases. (If it is, Textdrive has PHP5;) )

Possible Problem: The header is saved in the cached file. If you only want to serve the xml-mimetype to those browsers that understand it, and text/html otherwise, you will also have to change the method “jpcache_restore” (in the same file.php) to not just read the type, but to check it against the Accept-Headers of the Browser.

If that all would solve the problem, I would adjust the code for the next release.

Questions: If an HTML Document starts with:
<notextile><pre>
<?xml version=“1.0” encoding=“utf-8” ?>
<!DOCTYPE
</pre></notextile>
will it always be sent as “application/xhtml+xml;charset=utf-8” (if we assume the browser understands it)? If a document should be served with that mimetype, does it always begin with that snippet?

edit: Nevermind my questions, I am looking at the code of your plugin right now. Thinking how best to take care of that…

Last edited by Sencer (2005-05-19 08:37:01)

Offline

Board footer

Powered by FluxBB