<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Jeffrey Ng wrote:</span></font><br>
<font color=navy><span style='color:navy'>&gt;</span></font>so are you saying
in general catalyst is pretty heavy, and its not for site with many concurrent
users?... <font size=2 color=navy face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:navy'><o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>No, not at all. It all depends on what
your application does, how many web screens, how many peak concurrent users and
equivalent requests/second, how many discrete users, how many data feeds
in/out, data volumes, network transfer volumes.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Your limiting factor might be CPU,
database I/O or network bandwidth.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Different architectural models are best
for different cases.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>There is a cost equation between using a
powerful framework that increases robustness, maintainability and speed of
development versus how many servers you need.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Say a server costs you $100 per month to
rent and each Catalyst server maxes at 30 requests per second but you get a
peak load of 90 reqs/sec. You would need to load balance your app across 3
servers. There would be an initial configuration cost and then you&#8217;d be
paying $200 p.m. = $2400 p.a. more for the two extra servers.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Let&#8217;s say a developer, including
overhead, costs you $1000 per day. If you move away from Catalyst to a lighter
framework and it costs you more than 2.5 developer days extra then you&#8217;re
losing money. Catalyst has a lot of tried and tested pluggable modules and if
you end up re-writing any of those you&#8217;re almost certainly spending
money.<o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>&gt;</span></font>what other light weight
approach would you go for?<o:p></o:p></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>First thing, set up proper caching (either
Squid or a lightweight Apache) and use a tool like Fiddler to examine the HTTP
request Cache headers to make sure it&#8217;s working properly. That&#8217;s a
huge saving.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Then do profiling and benchmarking to
determine exactly what the bottlenecks are before making any changes.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>If you&#8217;re doing a lot of dynamic
Ajax stuff with complex SQL, there might be a case for hand-tuning that part of
the app. Look at whether you can pre-calculate and cache expensive queries or
change the app design to allow this. If necessary, you could write a separate
lightweight app to serve those requests.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I didn&#8217;t find a suitable lightweight
mod_perl framework so wrote one using CGI::Session, DBIx::Class, Template
toolkit. It&#8217;s not that difficult.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>If you would like some details please feel
free to email off-list or call me. However, that was an atypical case and as
soon as you start needing internationalization, RSS feeds etc. I think
you&#8217;re better off with Catalyst.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You said you need to serve JS from the
same server as the heavyweight app. Assuming the JS pages are static or can be
precalculated and stored in a static dir, and you have the JS below /js and
your app below /app in the URI namespace:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>On the same server run two Apaches (or one
Apache + one Fastcgi)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>1) Lightweight proxy. Build it yourself
from source, turn off all unnecessary options and shared libraries except
mod_proxy/mod_rewrite.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Use rewrite rules to proxy /app/&#8230; on
to heavy server, e.g. based on an Apache 1 setup I have that&#8217;s live:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp; RewriteEngine On<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;
RewriteRule&nbsp;&nbsp;&nbsp; ^/app/(.*$)&nbsp;&nbsp; http://localhost:2000/app/$1&nbsp;
[P]<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;
ProxyPassReverse&nbsp;&nbsp; /&nbsp;&nbsp; http://localhost:2000/<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;
RewriteRule&nbsp;&nbsp;&nbsp; ^proxy:.*&nbsp; -&nbsp; [F]<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The /js and /images get served by the proxy
server (which has a &lt;1MB memory footprint per child)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>2) Heavy mod_perl server listening at
localhost:2000. Maps /app on to your handler (40-100MB memory per child).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Say you had to handle the <st1:place
w:st="on"><st1:City w:st="on">Ajax</st1:City></st1:place> part separately. With
this model you can add another proxy entry that routes, say, /ajax/ on to
another Apache server on the same host (e.g. localhost:2001) or on another host
altogether (e.g. <a href="http://ajax1.zorpia.com/">http://ajax1.zorpia.com</a>).
If you need to scale more, use DNS round robin to a set of front end proxies
like this and route requests to a farm of backend servers using a shared
database server.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I&#8217;d be surprised if you
couldn&#8217;t get decent performance out of a well-designed Catalyst app.
There are businesses listed on the Catalyst pages that offer consultancy help
if you need further pointers. As a business I used Shadowcat Systems last year
and received good technical design advice.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Peter Edwards<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><a href="http://www.dragonstaff.com/">www.dragonstaff.com</a>
~ Business IT Consultancy<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>