I use palywebframe to do the same test, palywebframe efficiency is very
high, when I use (AB -n 20000 -c 20000 http://127.0.0.1:8001/index) test,
CB error, I replaced Emysql as the driver, the database is not wrong, but
CB still error, me ulimit also made an adjustment, ERL_MAX_PORTS also made
adjustments, CB or error, these tests are in a production environment do,
error as follows:
2014-12-07 19:17:40.538 [error] < 0.29943.0>
@boss_web_controller_handle_request:handle_request:31 Unhandled Error:
exit:normal Stacktrace: [{mochicow_request, send, 2, [{file, "
src/mochicow_request.erl"}, {mochicow_request, 156}]}, {line, respond,
2, [{file, " src/mochicow_request.erl"}, {line, 406}]},
{boss_web_controller_handle_request, handle_request, 4, [{file, "
src/boss/boss_web_controller_handle_request.erl"}, {line, 27}]},
{mochicow_upgrade, upgrade, 4, [{file, "
src/mochicow_upgrade.erl"}, {line, 72}]}, {cowboy_protocol, execute,
4, [{file, " src/cowboy_protocol.erl"}, {line, 529}]}]
2014-12-07 19:17:40.542 [error] < 0.29944.0>
@boss_web_controller_handle_request:handle_request:31 Unhandled Error:
exit:normal Stacktrace: [{mochicow_request, send, 2, [{file, "
src/mochicow_request.erl"}, {line, 156}]} {mochicow_request, respond,
2, [{file, " src/mochicow_request.erl"}, {line, 406}]},
{boss_web_controller_handle_request, handle_request, 4, [{file, "
src/boss/boss_web_controller_handle_request.erl"}, {line
{mochicow_upgrade, upgrade, 27}]}, 4, [{file, "
src/mochicow_upgrade.erl"}, {line, 72}]}, {cowboy_protocol, execute,
4, [{file, " src/cowboy_protocol.erl"}, {line, 529}]}]
2014-12-07 19:17:40.547 [error] < 0.29945.0>
@boss_web_controller_handle_request:handle_request:31 Unhandled Error:
exit:normal Stacktrace: [{mochicow_request, send, 2, [{file, "
src/mochicow_request.erl"}, {line, 156}]} {mochicow_request, respond,
2, [{file, " src/mochicow_request.erl"}, {line, 406}]},
{boss_web_controller_handle_request, handle_request, 4, [{file, "
src/boss/boss_web_controller_handle_request.erl"}, {line
{mochicow_upgrade, upgrade, 27}]}, 4, [{file, "
src/mochicow_upgrade.erl"}, {line, 72}]}, {cowboy_protocol, execute,
4, [{file, " src/cowboy_protocol.erl"}, {line, 529}]}]
I use translation software to write a reply, what grammar is not the right
place, please forgive me, thank you
在 2014年12月5日星期五UTC+8下午10时00分51秒,Evgeny M写道:
>
> 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/77f0c8df-f85d-41e4-8dd9-0889a2254242%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.