what's the matter ? user ab test CB,i user SSD

39 views
Skip to first unread message

leeyo...@gmail.com

unread,
Dec 4, 2014, 8:05:57 PM12/4/14
to chica...@googlegroups.com
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)


Evgeny M

unread,
Dec 5, 2014, 9:00:51 AM12/5/14
to chica...@googlegroups.com
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 пользователь leeyo...@gmail.com написал:

leeyo...@gmail.com

unread,
Dec 7, 2014, 10:53:58 PM12/7/14
to chica...@googlegroups.com
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] &lt; 0.29943.0&gt; @boss_web_controller_handle_request:handle_request:31 Unhandled Error: exit:normal Stacktrace: [{mochicow_request, send, 2, [{file, &quot; src/mochicow_request.erl&quot;}, {mochicow_request, 156}]}, {line, respond, 2, [{file, &quot; src/mochicow_request.erl&quot;}, {line, 406}]}, {boss_web_controller_handle_request, handle_request, 4, [{file, &quot; src/boss/boss_web_controller_handle_request.erl&quot;}, {line, 27}]}, {mochicow_upgrade, upgrade, 4, [{file, &quot; src/mochicow_upgrade.erl&quot;}, {line, 72}]}, {cowboy_protocol, execute, 4, [{file, &quot; src/cowboy_protocol.erl&quot;}, {line, 529}]}]

2014-12-07 19:17:40.542 [error] &lt; 0.29944.0&gt; @boss_web_controller_handle_request:handle_request:31 Unhandled Error: exit:normal Stacktrace: [{mochicow_request, send, 2, [{file, &quot; src/mochicow_request.erl&quot;}, {line, 156}]} {mochicow_request, respond, 2, [{file, &quot; src/mochicow_request.erl&quot;}, {line, 406}]}, {boss_web_controller_handle_request, handle_request, 4, [{file, &quot; src/boss/boss_web_controller_handle_request.erl&quot;}, {line {mochicow_upgrade, upgrade, 27}]}, 4, [{file, &quot; src/mochicow_upgrade.erl&quot;}, {line, 72}]}, {cowboy_protocol, execute, 4, [{file, &quot; src/cowboy_protocol.erl&quot;}, {line, 529}]}]

2014-12-07 19:17:40.547 [error] &lt; 0.29945.0&gt; @boss_web_controller_handle_request:handle_request:31 Unhandled Error: exit:normal Stacktrace: [{mochicow_request, send, 2, [{file, &quot; src/mochicow_request.erl&quot;}, {line, 156}]} {mochicow_request, respond, 2, [{file, &quot; src/mochicow_request.erl&quot;}, {line, 406}]}, {boss_web_controller_handle_request, handle_request, 4, [{file, &quot; src/boss/boss_web_controller_handle_request.erl&quot;}, {line {mochicow_upgrade, upgrade, 27}]}, 4, [{file, &quot; src/mochicow_upgrade.erl&quot;}, {line, 72}]}, {cowboy_protocol, execute, 4, [{file, &quot; src/cowboy_protocol.erl&quot;}, {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写道:
Reply all
Reply to author
Forward
0 new messages