Elixir – Dynamo + AngularJS

https://github.com/parroty/dynamo_angular

I was playing around Dynamo with AngularJS, and resulted in a simple scaffold application.

Dynamo itself doesn’t have datastore, so Ecto with PostgreSQL is applied too. Some features are missing compared with Rails’ ActiveRecord, but CRUD operations just worked by adding some of the additional logics (ex. Ecto seems not have built-in json. The above one is just manually extracting fields from Ecto.Model).

Very simple benchmarking

Tried to compare it with previously created rails version.

Conditions are,

  • Macbook Air
  • PostgreSQL 9.3.2
  • Acquiring 10 records of json
  • 1000 requests with 100 concurrency (ab -n 1000 -c 100 http://localhost:xxxx/crews)

Then the [Requests per second] resulted in the following.

  • Dynamo version: 481.90 #/sec
  • Rails version: 172.42 #/sec

I haven’t been able to match the condition well (ex. Total transferred bytes are larger in rails), but I can see the certain amount of difference between them.

Dynamo

Server Software:
Server Hostname:        localhost
Server Port:            4000

Document Path:          /crews
Document Length:        420 bytes

Concurrency Level:      100
Time taken for tests:   2.075 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      565000 bytes
HTML transferred:       420000 bytes
Requests per second:    481.90 [#/sec] (mean)
Time per request:       207.510 [ms] (mean)
Time per request:       2.075 [ms] (mean, across all concurrent requests)
Transfer rate:          265.89 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   1.1      0       5
Processing:     7  197  27.4    201     254
Waiting:        7  197  27.4    201     254
Total:         12  198  26.7    201     257

Rails (v3.2.13 with Thin)

Server Software:        thin
Server Hostname:        localhost
Server Port:            3000

Document Path:          /crews
Document Length:        412 bytes

Concurrency Level:      100
Time taken for tests:   5.800 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      787000 bytes
HTML transferred:       412000 bytes
Requests per second:    172.42 [#/sec] (mean)
Time per request:       579.982 [ms] (mean)
Time per request:       5.800 [ms] (mean, across all concurrent requests)
Transfer rate:          132.51 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.9      0       5
Processing:   280  557  53.8    559     783
Waiting:      216  502  54.4    506     735
Total:        284  558  53.3    559     785
Advertisements

Posted on February 9, 2014, in Elixir, Web. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: