You probably run your tests against CB in debug mode, started with 
./init-dev.sh. In this mode CB recompiles some changed modules on each 
request. Compile your app with ./rebar compile all and start it with 
./init.sh start - you should get about 2 magnitudes more requests per 
second.

io:format can slow down requests processing too, in real app you usually 
don't do console output.

пятница, 5 декабря 2014 г., 4:05:57 UTC+3 пользователь [email protected] 
написал:
>
> testjpa.erl
> -module(testjpa,[Id,Name]).
> -table("testjpa").
>
> testapp_index_controller.erl
>
> -module(testapp_index_controller,[Req]).
> -compile(export_all).
>
> -default_action(index).
>
>
> index('GET',[]) ->
>           Test  = testjpa:new(id, "ebeandd"),
>           Test:save(),
>           
>   lists:foreach(fun(T) -> 
>                    io:format("test: ~p~n", [T:name()]) 
>         end, boss_db:find(testjpa, [{name ,'eq', "ebeandd"}])),
>
> {output,"ok"}.
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------
> ab -n 1000 -c 100 http://127.0.0.1:8001/index
> This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 100 requests
> Completed 200 requests
> Completed 300 requests
> Completed 400 requests
> Completed 500 requests
> Completed 600 requests
> Completed 700 requests
> Completed 800 requests
> Completed 900 requests
> Completed 1000 requests
> Finished 1000 requests
>
>
> Server Software:        MochiWeb/1.0
> Server Hostname:        127.0.0.1
> Server Port:            8001
>
> Document Path:          /index
> Document Length:        2 bytes
>
> Concurrency Level:      100
> Time taken for tests:   98.104 seconds
> Complete requests:      1000
> Failed requests:        7
>    (Connect: 0, Receive: 0, Length: 7, Exceptions: 0)
> Non-2xx responses:      7
> Total transferred:      165589 bytes
> HTML transferred:       10435 bytes
> Requests per second:    10.19 [#/sec] (mean)
> Time per request:       9810.406 [ms] (mean)
> Time per request:       98.104 [ms] (mean, across all concurrent requests)
> Transfer rate:          1.65 [Kbytes/sec] received
>
> Connection Times (ms)
>               min  mean[+/-sd] median   max
> Connect:        0    0   1.1      0       5
> Processing:   525 9658 10669.7   6630   45090
> Waiting:      449 9656 10670.8   6630   45090
> Total:        528 9658 10669.4   6630   45091
>
> Percentage of the requests served within a certain time (ms)
>   50%   6630
>   66%   9123
>   75%  10563
>   80%  11640
>   90%  30033
>   95%  40206
>   98%  44731
>   99%  44886
>  100%  45091 (longest request)
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/chicagoboss/139caa8d-dde6-43b7-9734-9edf86080f4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to