简体   繁体   English

重载下IIS上的ActiveState Perl崩溃

[英]ActiveState Perl crashes on IIS under heavy load

I have a problem running ActiveState Perl 5.16.2 (32-bit) on a Windows 2008 Server (64-bit) with IIS 7.5. 我在带有IIS 7.5的Windows 2008 Server(64位)上运行ActiveState Perl 5.16.2(32位)时遇到问题。 Perl is run using PerlIS.dll with an ISAPI filter in IIS. Perl是使用PerlIS.dll和IIS中的ISAPI筛选器运行的。

There seems to be a problem related with heavy load and/or concurrent connections that generate seemingly random error messages. 似乎与重负载和/或并发连接有关,该问题生成看似随机的错误消息。

Here are a few sample errors: 以下是一些示例错误:

*** 'C:\inetmli\wwwroot\ldope\index.cgi' error message at: 2013/02/28 13:01:07
Variable "%Config" is not imported at C:/Perl/lib/Config.pm line 53.
Variable "%Config" is not imported at C:/Perl/lib/Config.pm line 94.
Global symbol "%Config" requires explicit package name at C:/Perl/lib/Config.pm line 53.
Global symbol "%Config" requires explicit package name at C:/Perl/lib/Config.pm line 94.
Compilation failed in require at C:/Perl/lib/Errno.pm line 8.
BEGIN failed--compilation aborted at C:/Perl/lib/Errno.pm line 8.
Compilation failed in require at C:/Perl/lib/IO/Socket.pm line 18.
BEGIN failed--compilation aborted at C:/Perl/lib/IO/Socket.pm line 18.
Compilation failed in require at C:/Perl/site/lib/Net/LDAP.pm line 9.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Net/LDAP.pm line 9.
Compilation failed in require at C:\inetmli\wwwroot\test\index.cgi line 4.
BEGIN failed--compilation aborted at C:\inetmli\wwwroot\test\index.cgi line 4.

*** 'C:\inetmli\wwwroot\ldope\index.cgi' error message at: 2013/02/28 13:01:07
String found where operator expected at (eval 4) line 2, near "croak 'usage: $io->getline()'"
    (Do you need to predeclare croak?)
String found where operator expected at (eval 4) line 8, near "croak 'usage: $io->getlines()'"
    (Do you need to predeclare croak?)
String found where operator expected at (eval 4) line 10, near "croak 'Can\'t call $io->getlines in a scalar context, use $io->getline'"
    (Do you need to predeclare croak?)
syntax error at (eval 4) line 2, near "croak 'usage: $io->getline()'"
syntax error at (eval 4) line 8, near "croak 'usage: $io->getlines()'"
syntax error at (eval 4) line 10, near "croak 'Can\'t call $io->getlines in a scalar context, use $io->getline'"
Compilation failed in require at C:/Perl/lib/IO/Socket.pm line 12.
BEGIN failed--compilation aborted at C:/Perl/lib/IO/Socket.pm line 12.
Compilation failed in require at C:/Perl/site/lib/Net/LDAP.pm line 9.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Net/LDAP.pm line 9.
Compilation failed in require at C:\inetmli\wwwroot\test\index.cgi line 4.
BEGIN failed--compilation aborted at C:\inetmli\wwwroot\test\index.cgi line 4.

*** 'C:\inetmli\wwwroot\ldope\index.cgi' error message at: 2013/02/28 13:01:07
Can't locate loadable object for module main in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/lib/DynaLoader.pm line 99, <DATA> line 635.
    DynaLoader::croak('Can\'t locate loadable object for module main in @INC (@INC c...') called at C:/Perl/lib/DynaLoader.pm line 161
    DynaLoader::bootstrap('main') called at C:/Perl/lib/DynaLoader.pm line 106
    DynaLoader::bootstrap_inherit('main') called at C:/Perl/lib/POSIX.pm line 0
    require POSIX.pm called at C:/Perl/lib/POSIX.pm line 0
    PDF::API2::Util::BEGIN() called at C:/Perl/lib/POSIX.pm line 0
    eval {...} called at C:/Perl/lib/POSIX.pm line 0
    require PDF/API2/Util.pm called at C:/Perl/lib/POSIX.pm line 0
    PDF::API2::BEGIN() called at C:/Perl/lib/POSIX.pm line 0
    eval {...} called at C:/Perl/lib/POSIX.pm line 0
    require PDF/API2.pm called at C:\inetmli\wwwroot\test\index.cgi line 13
Compilation failed in require at C:/Perl/site/lib/PDF/API2/Util.pm line 31, <DATA> line 635.
BEGIN failed--compilation aborted at C:/Perl/site/lib/PDF/API2/Util.pm line 31, <DATA> line 635.
Compilation failed in require at C:/Perl/site/lib/PDF/API2.pm line 9, <DATA> line 635.
BEGIN failed--compilation aborted at C:/Perl/site/lib/PDF/API2.pm line 9, <DATA> line 635.
Compilation failed in require at C:\inetmli\wwwroot\test\index.cgi line 13, <DATA> line 635.

The script being executed is a very simple test script using many libraries: 正在执行的脚本是使用许多库的非常简单的测试脚本:

use strict;
use Net::LDAP;
require Archive::Zip;
require CAM::PDF;
require DBI;
require Excel::Writer::XLSX;
require HTTP::Request;
require LWP::UserAgent;
require MIME::Base64;
require MIME::QuotedPrint;
require PDF::API2;
require PHP::Serialization;
require Socket;
require Win32::Process;

print "HTTP/1.1 200 OK\nContent-Type: text/plain\n\nI'm OK!";

When requesting this script multiple times I can generate the error quite often, but there is no apparent pattern to when or what causes it. 当多次请求此脚本时,我经常会生成错误,但是没有明显的模式可以确定何时或由何原因引起。 I even managed to get the error using just the single last line as a script: 我什至只使用最后一行作为脚本就设法得到了错误:

print "HTTP/1.1 200 OK\nContent-Type: text/plain\n\nI'm OK!";

The error from that was: 由此产生的错误是:

*** 'C:\inetmli\wwwroot\ldope\index.cgi' error message at: 2013/02/28 12:26:25
syntax error at C:\inetmli\wwwroot\test\index.cgi line 1, near "K!"
Can't find string terminator '"' anywhere before EOF at C:\inetmli\wwwroot\test\index.cgi line 26, <DATA> line 635.

I must run the script thousands of time from multiple threads from my PC to generate this error and it only triggers a few times. 我必须在PC上的多个线程中运行脚本数千次,以生成此错误,并且仅触发几次。 I believe it to be triggered by concurrent access. 我相信它是由并发访问触发的。

From that error it seems it did not read the whole file when it started to parse it? 从该错误看来,它开始解析时似乎没有读取整个文件?

This bug is annoying me to insanity! 这个错误使我感到疯狂! On a heavy load server it generates errors quite often and sometimes the whole application pool in IIS crashes and has to be restarted. 在高负载服务器上,它经常产生错误,有时IIS中的整个应用程序池崩溃,必须重新启动。

Has anyone seen this before? 谁看过这个吗? Is there a know work around? 是否有已知的解决方法? Preferably I would like to stay with ISAPI since the other options (PerlEX and FastCGI is untested with the current code). 最好是我想继续使用ISAPI,因为其他选项(PerlEX和FastCGI未使用当前代码进行测试)。

I would be very thankfull for any help or tip to help me solve my problem. 我将非常感谢您提供的任何帮助或提示,以帮助我解决问题。 Since I haven't found anything on the web maybe it could also help someone else who is struggeling with these seemingly random error messages. 既然我在网络上还没有找到任何东西,也许它也可以帮助正在努力处理这些看似随机的错误消息的其他人。

So far I've tried: 到目前为止,我已经尝试过:

  • splitting applications up in different application pools (only positive effect is that a crashed application now is limited to the current application pool) 在不同的应用程序池中拆分应用程序(唯一的积极效果是,崩溃的应用程序现在仅限于当前应用程序池)
  • adding multiple worker processes to a single application pool (made the errors rarer but not dissapear) 将多个辅助进程添加到单个应用程序池中(使错误少见但不会消失)
  • setting processor affinity to true 将处理器关联性设置为true
  • setting application pool recycling both very high and very low to no apparent effect 设置应用程序池的回收率很高或很低,几乎没有效果
  • using all kinds of "classic"/"pipeline" and ASP.NET settings despite knowing they probably have nothing to do with it 使用各种“经典” /“管道”和ASP.NET设置,尽管知道它们可能与它无关
  • Perl 5.14 does NOT have this problem, only Perl 5.16 Perl 5.14没有这个问题,只有Perl 5.16

Anyone got any more ideas? 还有其他想法吗?

就我而言(MacOS),当线程数大于120时,STDOUT-> flush()中会随机出现错误。我在线程环境中将其删除,问题消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM