Update:

Finally I found where the memory leak was and I'm sorry Starman to blame you :) In the program we use a binding library wich works perfect in a regular execution but for a reason I can't figure out, in a multiprocess situation eat all the memory. This bug have been sended to the author of the perl library.


I have developed a RESTful application with perl framework Dancer. This application needs almost 1 GB in memory and it takes 30 seconds to be loaded. This application works pretty well in a local test with ./bin/app.pl for a single user, then I try to deploy with Starman (alone or with plackup, with and without keep-alive) for multi-tenant use in several different ways:

plackup -E production -s Starman --workers=10 -p 3000 -a bin/app.pl plackup -E production -s Starman --workers=10 -p 3000 -a bin/app.pl -- +disable-keepalive plackup -E production -s Starman --workers=10 -p 3000 -a bin/app.pl -- +disable-keepalive --preload-app starman --workers=10 -p 3000 -a bin/app.pl

Deployment success, but for each query Starman allocates some memory which never free any more, so the application go out of memory very fast.

I read all the documentation of Starman, PSGI and Dancer deployment, included a very nice explanation of NGINX/Starman/Dancer and a similar error with Starman and memory but it doesn't solve this one, because I disable keep-alive and Starman still keep the memory.

Any idea why Starman is eating my memory? Thanks!

Disclaimer: I posted this question in Stackoverflow and someone recomend me to came to the monastery :)


In reply to Starman eat all the memory with Dancer REST api by sakinho

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.