Warning: Twiggy is asynchronous in the sense that it runs on top of an AnyEvent event loop. This means that all code in the request handlers has to be written in an asynchronous, callback style. If any part of that code ever blocks, the entire server becomes unresponsive. This is especially tricky if the request handlers have to do database operations; I only have direct experience with PostgreSQL, which has async support, but with severe limitations. For example, you have to implement connection pooling yourself if you ever want to serve more than one database operations at the same time.
OTOH, I second the recommendation of Starman. By default, it works as a pre-forked server with a fixed number of workers (it even reaps and restarts its workers after they've served a number of requests), but it can be coaxed to adjust the number of workers between a configurable minimum and maximum in response to the server traffic (these options are not mentioned in Starman's docs, you have to dig down into Net::Server::PreFork, on which it is based on).
Starman is also "easier" in the sense that if you have some simple, naive, synchronous server code that works with plackup's default server, it will work with Starman too with no changes.
-
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.
|