Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

When I run strace (I've seen discussions that start this way but no answer to my question that follows) on my script it performs a lot of "stat" lookups before it succeeds to find the right modules. A sample sequence of "stat" tried file candidates for use Time::HiRes is below with the last one being valid.

/etc/perl/Time/HiRes.pmc
/etc/perl/Time/HiRes.pm
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/Time/HiRes.pmc
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/Time/HiRes.pm
/usr/local/share/perl/5.30.0/Time/HiRes.pmc
/usr/local/share/perl/5.30.0/Time/HiRes.pm
/usr/lib/x86_64-linux-gnu/perl5/5.30/Time/HiRes.pmc
/usr/lib/x86_64-linux-gnu/perl5/5.30/Time/HiRes.pm
/usr/share/perl5/Time/HiRes.pmc
/usr/share/perl5/Time/HiRes.pm
/usr/lib/x86_64-linux-gnu/perl/5.30/Time/HiRes.pmc
/usr/lib/x86_64-linux-gnu/perl/5.30/Time/HiRes.pm

We use a lot of real time perl scripting in an envoronment with high IOPS. Accumulated load time lag becomes noticeable. I am looking for a way to eliminate lookups on non-existent files and directories.

One solution I can think of is to create links like

ln -s /usr/lib/x86_64-linux-gnu/perl/5.30/Time /etc/perl/Time
This solution sounds a bit scary. It would require creating dozens of links (one per package) and it would be dependent on the the distribution package management, which may change during upgrades. I am looking for something safer, something more ... standard (?)

LD_PRELOAD environment variable comes to mind but I am not at that level to fully understand how to correctly use it.

Perl seems to have no default /etc configuration, at least not the way many other linux software use it. So this is my predicament.


In reply to Perl startup and excessive "stat" use on module load by cherio

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-03-28 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found