Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default mod_perl warnings

    I have been a perl cgi developer for about 8 years.
    I have been wanting to develop a nice mod_perl system for a long time,
    and recently did.

    However, there are some significant drawbacks to mod_perl I have come
    across in production that I wish were explained to people a lot more
    prominantly as drawbacks to mod_perl.

    1. With CGI, production changes are simple: copy the cgi to a
    different filename, make and test changes, and copy it back -
    something broken? revert to earlier copy in less then 1 second. With
    mod_perl, it is much more involved, including renaming not only files
    but module package names within the files (twice) and httpd.conf
    entries, plus server hups. For this reason alone I am converting most
    of my code back to CGI.

    With CGI, I never hesitate to jump in and make the most trivial of
    corrections to production code. With mod_perl, I usually let them
    languish until the list is big enough to warrant the procedure.

    2. If you have mod_perl which serves downloads, the downloads will be
    disconnected during a webserver restart (like for log rotation), even
    if it is graceful.

    3. If you use persistant DBI, which is a primary reason to want to use
    mod_perl, it frequently dumps tons of ignorable but extremely annoying
    'attempt to free unreferenced scalar' messages in your weblogs which
    are very difficult to weed out.

    If anyone knows any workarounds to these problems, please let me know
    - but when I have read other people post about them, you can hear
    crickets chirp in response.
    Seth Brundle Guest

  2. Similar Questions and Discussions

    1. Getting rid of PDF warnings.
      Every time I open a PDF for the first time that has layers or security I get warning about it. This is becoming exceedingly irritating. The dialog...
    2. memory warnings
      I am running FH10 with Win2000 and I am getting warnings to the effect of: "Cannot draw, there is not enough memory." However, I have over 1500mbs of...
    3. apache hangs when warnings are enabled in mod_perl
      Hi, I'm running Apache 1.3.27, mod_perl 1.26, and mysql 3.23. I've got a strange problem that is caused by enabling warnings in my code. I've...
    4. -w vs. use warnings
      Hello everyone, Having been a Perl programmer for several years now I have become accustom to using the following as my normal "start" of any...
    5. Warnings?
      Hi, In message "Warnings?" on 03/07/29, Tim Bates <tim@bates.id.au> writes: |I've recently got around to reinstating some of my old Ruby apps...
  3. #2

    Default Re: mod_perl warnings

    Hi,

    In message <53e2ec95.0306260825.79680d79@posting.google.com >, Seth
    Brundle <brundlefly76@hotmail.com> writes
    >I have been a perl cgi developer for about 8 years.
    >I have been wanting to develop a nice mod_perl system for a long time,
    >and recently did.
    Sounds like me!
    >
    >However, there are some significant drawbacks to mod_perl I have come
    >across in production that I wish were explained to people a lot more
    >prominantly as drawbacks to mod_perl.
    >
    >1. With CGI, production changes are simple: copy the cgi to a
    >different filename, make and test changes, and copy it back -
    >something broken? revert to earlier copy in less then 1 second. With
    >mod_perl, it is much more involved, including renaming not only files
    >but module package names within the files (twice) and httpd.conf
    >entries, plus server hups. For this reason alone I am converting most
    >of my code back to CGI.
    I do not find this - but I do use mod_perl handlers rather than registry
    or CGI like scripts. This means all my code is compiled at server
    startup.

    I prepare a new release, untar it into a new directory. Then when I
    change over, I switch a symbolic link from the old directory to the new
    directory and restart the server. I guess a similar approach would work
    for Registry scripts - though the restart might no longer be needed.
    >
    >With CGI, I never hesitate to jump in and make the most trivial of
    >corrections to production code. With mod_perl, I usually let them
    >languish until the list is big enough to warrant the procedure.
    My change control system means nothing is trivial, but other than the
    small interruption during the restart (which I would need to schedule)
    there is nothing to prevent me doing it.
    >
    >2. If you have mod_perl which serves downloads, the downloads will be
    >disconnected during a webserver restart (like for log rotation), even
    >if it is graceful.
    Not sure I can answer this, but if this is critical I'd be tempted to
    put these onto another web server instance - so that I wouldn't need to
    restart it very often.
    >
    >3. If you use persistant DBI, which is a primary reason to want to use
    >mod_perl, it frequently dumps tons of ignorable but extremely annoying
    >'attempt to free unreferenced scalar' messages in your weblogs which
    >are very difficult to weed out.
    I get some but not tons - perhaps because all the database connections
    that are requested are very similar.
    >
    >If anyone knows any workarounds to these problems, please let me know
    >- but when I have read other people post about them, you can hear
    >crickets chirp in response.
    Well that's my story - please feel free to poke holes in it.
    --
    Chad Hanna
    Chairman Berkshire Family History Society [url]www.berksfhs.org.uk[/url]
    Quality Family History Data [url]www.familyhistoryonline.net[/url]
    Chad Hanna Guest

  4. #3

    Default Re: mod_perl warnings



    Seth Brundle wrote:
    >
    > I have been a perl cgi developer for about 8 years.
    > I have been wanting to develop a nice mod_perl system for a long time,
    > and recently did.
    >
    > However, there are some significant drawbacks to mod_perl I have come
    > across in production that I wish were explained to people a lot more
    > prominantly as drawbacks to mod_perl.
    >
    > 1. With CGI, production changes are simple: copy the cgi to a
    > different filename, make and test changes, and copy it back -
    > something broken? revert to earlier copy in less then 1 second. With
    > mod_perl, it is much more involved, including renaming not only files
    > but module package names within the files (twice) and httpd.conf
    > entries, plus server hups. For this reason alone I am converting most
    > of my code back to CGI.
    This shouldn't be necessary -- it should be possible to tell the server
    to restart, or even to just reload those files which have changed,
    without having to do all that renaming.
    > With CGI, I never hesitate to jump in and make the most trivial of
    > corrections to production code. With mod_perl, I usually let them
    > languish until the list is big enough to warrant the procedure.
    >
    > 2. If you have mod_perl which serves downloads, the downloads will be
    > disconnected during a webserver restart (like for log rotation), even
    > if it is graceful.
    Have you considered using mod_cgi for downloads, and mod_perl for
    everything else? Remember, the biggest overhead of mod_cgi compared to
    other apache modules for serving scripts is the startup, the fork/exec.
    Since a large download is dominated by the data transer, not the
    startup, there should be little or no harm in using cgi instead of
    mod_perl in this case.
    > 3. If you use persistant DBI, which is a primary reason to want to use
    > mod_perl, it frequently dumps tons of ignorable but extremely annoying
    > 'attempt to free unreferenced scalar' messages in your weblogs which
    > are very difficult to weed out.
    >
    > If anyone knows any workarounds to these problems, please let me know
    > - but when I have read other people post about them, you can hear
    > crickets chirp in response.
    I know of nothing to do about number 2 on your list, but for 3, have you
    considered upgrading to the most recent version of mod_perl?

    That is, perl5.8.0 or 5.8.1, with mod_perl 2.0?

    Oh, and upgrading to the most recent version of DBI might also help.

    Also, try and figure out approximatly *when* those warnings are being
    produced, and just before that happens, install a $SIG{__WARN__} handler
    which supresses them, and passes ordinary warnings through.


    Another possibility would be to switch from mod_perl to mod_fastcgi or
    to mod_persistantperl. Both of these are generally faster than plain
    cgi scripts, and I'm quite certain that with mod_fastcgi, you *will*
    avoid the "Attempt to free unreferenced scalar" warnings (I'm not sure
    whether mod_persistantperl avoids it, though). And, both of them
    support persistant database connections.

    For both of these alternatives, each "cgi" script actually starts a
    mini-server, which the main apache process connects to and communicates
    with. To get a modified script to be reloaded, you simply change the
    perl script, then kill the mini-server process... which of course is
    seperate from the apache process, so killing the mini-server for one
    script won't interfere with anything else.

    For testing/development purposes, you can easily set each mini-server to
    only serve one or two requests and then exit, so you can omit the "kill
    the mini-server process" step of making modifications.

    --
    $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
    );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
    ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
    Benjamin Goldberg Guest

  5. #4

    Default Re: mod_perl warnings

    Seth,
    Have you looked at PersistentPerl ? It's brillant. Offers the pre-compiled
    advantage but with standard cgi scripts. Allows you to keep DBI handles
    alive, don't know about Persistent DBI, though.
    ~henq




    "Seth Brundle" <brundlefly76@hotmail.com> schreef in bericht
    news:53e2ec95.0306260825.79680d79@posting.google.c om...
    > I have been a perl cgi developer for about 8 years.
    > I have been wanting to develop a nice mod_perl system for a long time,
    > and recently did.
    >
    > However, there are some significant drawbacks to mod_perl I have come
    > across in production that I wish were explained to people a lot more
    > prominantly as drawbacks to mod_perl.
    >
    > 1. With CGI, production changes are simple: copy the cgi to a
    > different filename, make and test changes, and copy it back -
    > something broken? revert to earlier copy in less then 1 second. With
    > mod_perl, it is much more involved, including renaming not only files
    > but module package names within the files (twice) and httpd.conf
    > entries, plus server hups. For this reason alone I am converting most
    > of my code back to CGI.
    >
    > With CGI, I never hesitate to jump in and make the most trivial of
    > corrections to production code. With mod_perl, I usually let them
    > languish until the list is big enough to warrant the procedure.
    >
    > 2. If you have mod_perl which serves downloads, the downloads will be
    > disconnected during a webserver restart (like for log rotation), even
    > if it is graceful.
    >
    > 3. If you use persistant DBI, which is a primary reason to want to use
    > mod_perl, it frequently dumps tons of ignorable but extremely annoying
    > 'attempt to free unreferenced scalar' messages in your weblogs which
    > are very difficult to weed out.
    >
    > If anyone knows any workarounds to these problems, please let me know
    > - but when I have read other people post about them, you can hear
    > crickets chirp in response.

    henq Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139