I don't think the problem is the I/O of loading those perl scripts, the perl executable or associated perl libraries.

Normally, the Linux VM subsystem should automatically cache frequently read files in RAM, in order to speed up future reads. If you users are running the same perl script(s) thousands of times per day, then those scripts, and everything required to run them should be in RAM most of the time.

The only situation I can think of where those files would not get cached, are either your system is under severe memory pressure. (Try running free and see how much swap is in use, it ought to be none or very little on a modern server system), or you or someone else has been tweaking the VM subsystem tunable parameters, and stuffed them up. I don't think either scenario is likely.

As SuicideJunkie has suggested, you could create a RAM disc, and copy your perl install there. That would force your Kernel to keep the files in RAM, along with a load of other irrelevant files. I don't think that is a good idea. If your system is under memory pressure, the data will get moved to swap anyway, and if not it will make no difference.

Instead I think you should look for other causes of your poor performance. Unfortunately, I can't come up with any constructive suggestions on that.

Sorry I can't be positive help, but I do think you are chasing the wrong culprit.


In reply to Re: Techniques to cache perl scripts into memory ? by chrestomanci
in thread Techniques to cache perl scripts into memory ? by fx

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.