Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Catalyst/FastCGI and Perpetually Growing Perl Processes

by jeffthewookiee (Sexton)
on Oct 11, 2012 at 20:52 UTC ( #998546=perlquestion: print w/ replies, xml ) Need Help??
jeffthewookiee has asked for the wisdom of the Perl Monks concerning the following question:

Seeking knowledge on a solution/approach to the following problem: Have a large Catalyst Webapp that runs in FastCGI mode on our web servers. Over the course of a couple weeks, the Perl/fcgi processes grow slowly larger and larger until they overwhelm the memory resources of the server. It's generally thought it's a problem with a memory leak, although it just seems to me that the processes are living a long time and never releasing memory back to the system. Does anyone else have experience dealing with this kind of problem? What's the best approach?

Comment on Catalyst/FastCGI and Perpetually Growing Perl Processes
Re: Catalyst/FastCGI and Perpetually Growing Perl Processes
by Anonymous Monk on Oct 12, 2012 at 01:47 UTC
      Is it necessarily a memory leak though? It seems possible it's just a side effect of having a very long-running Perl process that's never going to release memory back to the system. mod_perl/Apache seem to anticipate this by having each web process only serve X requests before being re-spawned, re-starting the memory pool from scratch.

        Is it necessarily a memory leak though?

        yes, unintended memory growth is always a leak

        It seems possible it's just a side effect of having a very long-running Perl process that's never going to release memory back to the system.

        While that is possible (operating system memory managers are tricky) it is very unlikely. With proper scoping the memory should be stable, it might peak during requests, but it should stabilize.

        If it doesn't, and you didn't code a giant %CACHE hash, then it is definitely a leak (unintended memory growth). See Re^3: Scope of lexical variables in the main script for some links/discussion

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://998546]
Approved by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-12-27 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls