On Mar 3, 2005, at 10:49 AM, Bob Hutchison wrote:
On Mar 3, 2005, at 10:24 AM, Edi Weitz wrote:
On Thu, 3 Mar 2005 10:10:07 -0500, Bob Hutchison hutch@recursive.ca wrote:
Has anybody thought of how TBNL might be run without an apache server or mod_lisp involved? Why? I've got an application that would normally be run on a server, but it would be useful to have a standalone demo version. Setting up apache is not the kind of skill I'd expect from the end user of this particular application.
It seems to me that somehow getting Araneida talking to TBNL would be one route -- fake mod_lisp in an Araneida handler or replace TBNL's modlisp.lisp would be two possibilities.
I suppose aserve and cl-http are also possibilities, but I suspect that Araneida has something more to gain from TBNL.
Sounds like an interesting idea. I've never done this until now, though.
I think this is worth pursuing -- the more I think about it the more I'm convinced. I think Araneida might be the way to go because both packages will benefit. I want to avoid any changes to either Araneida or TBNL at least for the first pass at this, so I guess that an Araneida handler with a socket connection between them is an easy way to achieve this. The socket can be eliminated later. Going to have to worry about concurrent requests too...
Now all I have to do is find the time.
I've found some time in the last couple of days and pretty much have this working with Araneida (in LispWorks at least). I've got to track down a few little problems but nothing much (e.g. a spurious 404 error when using FireFox that doesn't happen with other browsers, and some also spurious and intermittent socket errors).
While doing this I noticed something a little funny with the dates associated with If-modified-since. TBNL (rfc-1123-date) produces dates like "Tue, 1 Feb 2005 13:49:29 GMT" while Safari produces dates like "Tue, 01 Feb 2005 13:49:29 GMT" -- same date but you can't compare them as strings. If you look at rfc2616 section 3.3.1 there is an example that has the leading 0 on the day of month. Safari produces a header with the leading 0 for If-modified-since, so files in the first 9 days of any month will never match. FireFox appears to return whatever you send it, so it works there. I think this is probably a bug in TBNL.
This turned out to be fairly straight forward in the end -- I tried several strategies and think I have a pretty simple one. Unfortunately the question becomes what is Araneida adding to this other than handling the request parsing.
It is *very* fast on my machine. I've appended part of the output from the apache ab utility for the direct to Araneida and apache/mod_lisp configurations (unfortunately, if I increase the concurrency level to 15 or more I get a lot of errors from Araneida). I don't have Araneida operating as a proxy behind apache at the moment so I have no benchmarks for that configuration (and this also means that I've not tested it). A similar application in Java (that is being replace by this CL version) can barely sustain 18 Kbytes/s (don't read too much into that number, the Java application runs much better if it is operating on something other than my notebook (Mac powerbook G4 1GHz 2G RAM) -- of course so might the lisp application). And remember, this is not a well conceived benchmark -- make of it what you will.
I'm going to download the most recent version of TBNL and integrate changes into that. There are not many and perhaps I can avoid them all. I'll get this cleaned up and then make it available.
Cheers, Bob
Araneida (directly) -> TBNL -------------------------------------
Document Length: 4288 bytes
Concurrency Level: 10 Time taken for tests: 63.614 seconds Complete requests: 5000 Failed requests: 0 Broken pipe errors: 0 Total transferred: 22415000 bytes HTML transferred: 21440000 bytes Requests per second: 78.60 [#/sec] (mean) Time per request: 127.23 [ms] (mean) Time per request: 12.72 [ms] (mean, across all concurrent requests) Transfer rate: 352.36 [Kbytes/sec] received
Connnection Times (ms) min mean[+/-sd] median max Connect: 0 17 218.8 0 3016 Processing: 10 109 42.7 100 365 Waiting: 9 109 42.7 100 365 Total: 10 127 221.6 101 3144
Percentage of the requests served within a certain time (ms) 50% 101 66% 119 75% 132 80% 141 90% 170 95% 198 98% 234 99% 282 100% 3144 (last request)
mod_lisp -> TBNL -------------------------------------
Document Length: 4288 bytes
Concurrency Level: 10 Time taken for tests: 96.451 seconds Complete requests: 5000 Failed requests: 0 Broken pipe errors: 0 Total transferred: 22764006 bytes HTML transferred: 21440000 bytes Requests per second: 51.84 [#/sec] (mean) Time per request: 192.90 [ms] (mean) Time per request: 19.29 [ms] (mean, across all concurrent requests) Transfer rate: 236.02 [Kbytes/sec] received
Connnection Times (ms) min mean[+/-sd] median max Connect: 0 5 13.5 0 154 Processing: 8 187 222.2 107 2246 Waiting: 0 185 222.9 105 2245 Total: 8 192 221.5 115 2246
Percentage of the requests served within a certain time (ms) 50% 115 66% 180 75% 248 80% 291 90% 445 95% 614 98% 890 99% 1083 100% 2246 (last request)