[Catalyst] Switching to a production server
Tomas Doran
bobtfish at bobtfish.net
Wed Sep 10 00:12:34 BST 2008
On 9 Sep 2008, at 23:19, Emily Heureux wrote:
> At this time, I don’t know anything about fast_cgi or configuring
> apache or what have you, to work with Catalyst, but before I take
> that on, my question is, is it likely that the slow loading of very
> small images has to do with the default myapp_server.pl, and
> switching to something else will make a big difference with loading
> images and possibly other files?
>
By default, the myapp_server.pl which comes with catalyst for
development is _single threaded_. This means that if you have 200
images on the page, each image will be fetched one after the other,
which will be slow.
In a real deployment environment, you won't be single threaded (your
browser is likely to download 4 things at once), which will help.
Assuming that the images are static, you also want to configure your
web server to serve them statically, so Catalyst will never see the
image requests, this will significantly lower the overhead of serving
these images.
I recommend you set your app up with something like what your real
deployment is going to be (e.g. if your real deployment is going to
be fastcgi, then get fastcgi going on your development machine to
test it with).
See how your app looks then, and if you've still got speed issues you
can look at profiling the request (if that's what is taking the
time), and/or optimising the content (e.g. by using CSS sprites to
reduce the number of images in the page)..
Cheers
t0m
More information about the Catalyst
mailing list