Hi,

Erm, you should use thumbnails, for every photo uploaded you make a small thumbnail on the way. I recommend you not doing resizing on the fly when a person is viewing the page, because it's slow once you have a lot of pages/users. On the other side if you have a photo of 2mb, and you show this image on a <img> defining smaller width and height, the server send the 2mb size image to the client, and the browser will do the "scaling"... Take a look at projects around treating the same situation.

Imager and Image::Magick are great modules for doing all this kind of stuff (changing images and so).

I have seen other approaches instead of creating and managing the thumbnails, was using Mason caching the thumbnails, so the first time it takes a few ms. more but once you have a cached thumbnail, it's like having the file normally around on your filesystem. See here.

I can't tell you if this is normal, since I don't see your code, but normally you can do some optimisations... ;-)

I think that you should write clean code, since memory is cheap, and today there is no problem to have 512mb or 1024mb on your webserver. Using mod_perl: than more memory than better.

Regards,

|fire| at irc

In reply to Re: 2 Questions on Images and Mod_perl mem usage by fmerges
in thread 2 Questions on Images and Mod_perl mem usage by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.