PayPlay.FM development.log

Tuesday, March 24, 2009

metal and activerecord

I've tried to move some small actions to Metal to make it faster but it actually became even slower.


Benchmarking localhost (be patient).....done

Server Software: Mongrel
Server Hostname: localhost
Concurrency Level: 1
Complete requests: 25
Failed requests: 0
Write errors: 0
Requests per second: 0.83 [#/sec] (mean)

Percentage of the requests served within a certain time (ms)
50% 5
66% 6
75% 45
80% 5007
90% 5008
95% 5009
98% 5010
99% 5010
100% 5010 (longest request)

At first I thought something was wrong with my code (as it usually happens) but numbers show that metal became equally slow after first several super fast calls. Commenting parts of my code made clear that it has something with AR because code without find() worked fine.

The answer told by Google was to call

ActiveRecord::Base.clear_active_connections!

before returning resulting array from call.

Metal wins with ~240 req/s when ActionController was almost twice slower.

Labels: ,

1 Comments:

  • Привет, Женя!
    А что случилось с payplay.fm - полгода нет обновлений и никаких известий о будущем сайта на англоязычных ресурсах не найти - одна надежда, что ты как нибудь прояснишь ситуацию...

    By Blogger R, at 1:52 AM  

Post a Comment

<< Home