开发者

ActivePerl on Windows/Apache performance problems

I would like to ask you for help. In our company, we have installed Bugzilla 4.0 on Windows machine. For running perl, w开发者_运维百科e are currently using ActivePerl.

The problem is, that we have around 50 users periodically querying the Bugzilla web service and server can't take this load. We have found out, that it is caused by perl.exe, which is being ran during every request. Server workload (CPUs) are on 90% during peaks.

Have you ever experienced this problems? Is any possible configuration, we can make, to improve the performance?

We are using: Apache 2.2.17 and ActivePerl 5.8.9 b829. Thank you very much in advance, it causes us (especially me) a lot of trouble.


This is a fairly common issue as sites grow. And it's not specifically limited to Perl either. There are solutions. As one person mentioned, there is mod_perl, which is essentially installed as an Apache module. It can be used in a sort of simple version via Apache::Registry, or you can go all the way by writing components that interact with the Apache API at each request phase. Whatever approach you take with mod_perl, there are a few common notes: It is a persistent process, meaning (in simple terms), Perl stays resident from one request to the next, to the next, so that you eliminate startup costs. CGI scripts often cannot be ported directly to mod_perl without some amount of cleanup and refactoring. Since the script runs in a persistent environment, global variables don't reset themselves between requests, for example. There's a whole list of 'gotchas' to overcome. To that end, Apache::Registry is somewhat easier to deal with in a mod_perl environment, at the expense of not providing 100% of the performance horsepower that programming for the API directly can provide. Nevertheless, it's a pretty good compromise.

Another option would be FastCGI, which you can read about at the FastCGI website.

Well written CGI scripts can be ported to mod_perl or to FastCGI with some effort. These are probably the least painful approaches, for that reason. Some scripts can be converted with very little cleanup. Others may require a lot of work, but should be still possible.

Luckily there is a plethora of useful modules on CPAN to assist you in using mod_perl, or FastCGI. Under the Apache::* hierarchy on CPAN, for instance, you'll find many tools that are designed to work with mod_perl. With respect to FastCGI, you'll even find Catalyst and Mojolicious-related modules to help meld the two, though those last two suggestions would probably require some real refactoring.

I found Practical mod_perl to be helpful as a starting point (an O'Reilly book).


Food for thought: mod_perl

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜