Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Perl 5.32.0 Too many open files ... Runtime.pm

by eyepopslikeamosquito (Archbishop)
on Dec 03, 2020 at 06:42 UTC ( [id://11124569]=note: print w/replies, xml ) Need Help??


in reply to Perl 5.32.0 Too many open files ... Runtime.pm

I suggest you try to reproduce the problem reliably with the shortest program you can. Run this program with both Perl 5.30.0 and Perl 5.32.0 while (in another terminal session) monitor the open files of the offending process. When you compare the open files output of running the same program with Perl 5.30.0 vs Perl 5.32.0, hopefully something will jump out at you, probably something unexpected (after all, "Too many open files" is a rare error in my experience, usually indicating something is horribly wrong with the system or I made a boo-boo).

As for how to monitor which/how many files are open by a specific ubuntu linux process, you can google, as I did just now, finding this stack overflow question. Monitoring the details of open files on Linux can be tricky and requires root permissions for best results. The following Linux tools may be useful (examples can be found in the above stack overflow question):

  • lsof : fantastic tool for monitoring open files of running processes. Found some examples of using lsof at this blog and CatOnMat by Peteris Krumins (see also lsfd).
  • The /proc file system in conjunction with the ps command, e.g. ls /proc/$pid/fd/. Examples can be found in earlier stack overflow link.
  • The ulimit command.
  • Update: System call tracing (e.g. strace). Run the perl process with system call tracing on (for an example, see linux security cookbook). Needs root permissions (update: not always, see Fletch response below). For best results run the perl process directly via the strace command (strace can also be used to attach to a running process). Comparing the strace output (via diff say) between Perl 5.30.0 and Perl 5.32.0 should give you a clue as to what is going on.

HTH. I'm a bit rusty on all this stuff and don't have a test ubuntu system handy.

Updated: Noted that root permissions are often not required with strace (thanks Fletch). Minor clarifications and improvements to wording.

Replies are listed 'Best First'.
Re^2: Perl 5.32.0 Too many open files ... Runtime.pm
by Fletch (Bishop) on Dec 04, 2020 at 05:12 UTC

    You can run strace on your own processes on most *NIXen (either by starting them using it as a prefix to the command you want to trace, or after the fact by giving it a PID of an existing process owned by your UID). You only need to be root to attach to a different user's process. If you're on OS X the strace-alike there (dtruss) does need elevated privileges.</nitpick>

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124569]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found