Emily Heureux wrote: > > Hi, I have been developing a Catalyst application and just using the > Catalyst myapp_server.pl script to run it. We server a very small > market, currently less than 100 visits a day. The major issue we are > having is that even small images are loaded very slowly, and therefore > the pages are loaded slowly, on the order of more than 5 seconds for a > first time visitor. > > > > 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? > > > I don't recommend going live by running myapp_server.pl - this is intended for development and debugging. I do recommend using a standalone fastcgi process farm (which could have just a single instance), talking through a named pipe in the /tmp directory. The fastcgi process runs in your application user account, saving you from having to open up the permissions of your files to the www-data user.
This is quite well documented, see http://search.cpan.org/~mramberg/Catalyst-Runtime/lib/Catalyst/Engine/FastCGI.pm Also apart from in special circumstances, there's usually no reason to serve images through your Catalyst application. The special circumstances I imagine could be if the image is being stored in a database blob, or being tweaked on the fly with ImageMagick. One option could be to change the URLs for the images to be absolute ones on the webserver, rather than static/images/powered_by.jpg etc. which will deliver performance results with myapp_server.pl. You'd need to copy the root/static/images directory to somewhere more public, where the www-data user can see and use it. A recommended, documented option is to configure Apache to handle /static rather than pass these requests to the application with the following config snippet: <Location /static> SetHandler default-handler </Location> For more on configuring Apache 2.0, see http://search.cpan.org/~agrundma/Catalyst-Engine-Apache/lib/Catalyst/Engine/Apache2/MP20.pm Please bear it in mind that most of the information in this Pod is about configuring your Catalyst app to run under mod_perl. I much prefer fastcgi as it gives me much more control and awareness of machine resources, keeps my permissions sane, and allows me to run multiple different Catalyst applications and versions on the same box. Ivor. _______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
