Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Why are you recommending NOT to run mod_perl?

Well, there are some reasons not to use mod_perl. The main reason is that there is only one Perl interpreter instance (actually, there is one per worker process, cloned around forking the worker process). It runs inside the Apache process. Forking and cloning may cause some minor trouble, but that's rarely a problem. Mostly, this affects DBI, and Apache::DBI knows enough of DBIs internals to handle most of the problem. On Windows, Apache does not fork (as far as I know), but creates threads instead. So, everything runs in a single process.

The real problems are:

  • all applications have to share the one interpreter (per process)
  • all applications run in the process context of the Apache process
  • a single application error kills the entire Apache process
  • a single application error happening before Apache forks its worker processes kills the entire webserver

So, applications are de facto not isolated from each another, and you can not use operating system permissions to limit access to only one application or to the web server.

Compare with FastCGI:

  • The FastCGI process uses a single Perl interpreter for each application.
  • Each application runs inside its own process context, so you can isolate the applications using different users, filesystem permissions, chroot jails, and so on.
  • FastCGI communication uses sockets, either local ("Unix") sockets or TCP sockets. So you can run applications on different machines, perhaps behind firewalls that further isolate the web server.
  • FastCGI is available not only for Apache, but also for Nginx, IIS, Roxen, Lighttpd, and several other servers. So you don't have to re-invent the wheel just because you switch to a different webserver.

Of course, because FastCGI runs outside the Apache server, you have some communication overhead. And you can't use all of the Apache internals that mod_perl offers but rarely anyone uses.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^3: Misery: trying to get mod_perl working on Windows 2008 by afoken
in thread Misery: trying to get mod_perl working on Windows 2008 by stuckey

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 scrutinizing the Monastery: (4)
As of 2024-04-24 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found