Simple Socket Question?
Avi Bryant
avi at beta4.com
Tue Feb 18 03:01:23 UTC 2003
On Mon, 17 Feb 2003, Jimmie Houchin wrote:
> Hello,
>
> I'm trying to test the performance of Squeak for very simple http serving.
>
> The test I want to perform is Squeak answering a simple request like
> http://localhost:8000/test
> with nothing more than a simple string like 'Hello World!'.
>
> I want it as basic, low overhead (as fast) as possible.
If you have Comanche loaded (and thus its ConnectionHandler class), I
think this is minimal:
|output listener|
output _ 'HTTP/1.0 200 OK\Content-Type: text/html\\Hello World' withCRs withInternetLineEndings.
listener _ ConnectionHandler
onPort: 8000
handler: [:s | s getData; sendData: output; closeAndDestroy]
priority: Processor highIOPriority.
listener start.
On my system (1.4Ghz Athlon), ab gives me this:
Concurrency Level: 5
Time taken for tests: 0.480 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 55000 bytes
HTML transferred: 11000 bytes
Requests per second: 2083.33 [#/sec] (mean)
Time per request: 2.40 [ms] (mean)
Time per request: 0.48 [ms] (mean, across all concurrent requests)
Transfer rate: 114.58 [Kbytes/sec] received
Cheers,
Avi
More information about the Squeak-dev
mailing list
|