[Catalyst] Performance
Jim Spath
jspath at pangeamedia.com
Thu Mar 8 16:13:24 GMT 2007
Hi everyone,
We moved our Catalyst application to production servers yesterday and
seem to be getting lower than expected performance (around 9 req/s
between two load balanced servers).
On our development machine I ran myapp_server.pl through Devel::DProf,
hit it with a bunch of requests using ab, and got the following output:
%Time ExclSec CumulS #Calls sec/call Csec/c Name
9.86 3.378 3.378 21146 0.0002 0.0002 NEXT::ELSEWHERE::ancestors
7.46 2.554 7.446 23695 0.0001 0.0003 NEXT::AUTOLOAD
4.67 1.598 1.693 253442 0.0000 0.0000 URI::_generic::authority
4.45 1.524 1.524 282912 0.0000 0.0000 I18N::LangTags::is_language_tag
3.64 1.246 29.353 6736 0.0002 0.0044 Template::Document::__ANON__
3.47 1.190 2.239 5052 0.0002 0.0004 Cache::Memcached::_load_multi
3.36 1.150 1.226 223130 0.0000 0.0000 URI::_generic::path
3.26 1.118 1.656 284605 0.0000 0.0000 URI::_scheme
3.05 1.046 5.876 35365 0.0000 0.0002
Locale::Maketext::_langtag_munging
3.00 1.027 1.376 70728 0.0000 0.0000
I18N::LangTags::super_languages
2.97 1.016 8.664 35365 0.0000 0.0002 Locale::Maketext::get_handle
2.69 0.923 1.011 142308 0.0000 0.0000 URI::_init
2.49 0.854 25.371 199554 0.0000 0.0001 Template::Stash::XS::get
2.43 0.831 4.118 36207 0.0000 0.0001
I18N::LangTags::implicate_supers
2.39 0.817 1.256 70728 0.0000 0.0000
I18N::LangTags::encode_language_ta
As expected, NEXT took up a fair amount of time at around 17%. I had
read that Catalyst::Plugin::Class::C3 is worth checking out... should I
try it? Should I be worried about the potential for bugs?
The biggest problem seems to be localization at ~18%. I had been using
Catalyst::Plugin::I18N and calling Catalyst.localize() in our templates
for any string that required localization. Is there a better method for
doing localization, specifically with regards to performance?
URI is next up at around 14% of time. Is there anything that can be
done about this one?
Lastly, Template seems to be taking up around 6%. I suppose I could try
caching template output, but that will take some doing, as every page on
our site can vary per user.
Thanks in advance to anyone who answers!
Jim
PS - It may be worth noting that on production, we are running Catalyst
using myapp_fastcgi.pl through lighttpd.
More information about the Catalyst
mailing list