Welcome! Log In Create A New Profile

Advanced

Speed up perl by loading modules into memory?

Posted by youradds 
Speed up perl by loading modules into memory?
October 26, 2015 07:21AM
Hi,

I'm trying to get my perl scripts speeds up with nginx. We include quite a few perl modules - so I'm wondering if we can load them into memory, to speed up script requests. Here is a post I've started on Stack Overflow:

http://stackoverflow.com/questions/33316610/loading-perl-modules-into-memory-for-nginx-to-make-faster/33343357#33343357

Now, while I don't get errors on rebooting nginx, I really don't see that much of a difference in load times.

Before: 896ms "waiting"
After: 845ms "waiting"

Am I mis understanding how the perl_require works? Basically, I want to emulate what you get with mod_perl on Apache (where it loads the modules into memory)

Thanks

Andy
Re: Speed up perl by loading modules into memory?
November 07, 2015 07:53AM
Anyone? Surely there has to be some way of loading the Perl modules into memory on Nginx, so that they are ready for any perl script to use? (like we can do in mod_perl)
Re: Speed up perl by loading modules into memory?
November 07, 2015 08:17AM
We've extensively experimented with this option but without a proper Perl side cgi module this is not going to improve much, your best bet is to use a ramdrive for the whole perl environment and a simple cgi-wrapper to access Perl via fast_cgi, much the same as tcp->php-cgi works. Use a pool (upstream) to prevent blocking.

Basically the problem is shared environments and all the dangers that come with this. Typically Lua is much better suited for this but Lua ain't php or Perl, what's needed to solve this permanently is a Lua API which can expose php, python and Perl code in a non-blocking fashion. We're still experimenting with such API but getting stuck with blocking issues.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Speed up perl by loading modules into memory?
November 07, 2015 08:29AM
Hi,

Thanks for the response :) That went right over my head! I'll pass it onto my tech friend, and see what he makes of it :)

Thanks again!

Andy
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 117
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready