# Nginx-perl-1.1.17.1

**URL:** <https://www.ruby-forum.com/t/nginx-perl-1-1-17-1/217906>\
**Category:** NGINX\
**Created:** [March 15, 2012, 8:56pm UTC](https://www.ruby-forum.com/t/nginx-perl-1-1-17-1/217906 "2012-03-15T20:56:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 15, 2012, 8:56pm UTC](https://www.ruby-forum.com/t/nginx-perl-1-1-17-1/217906/1 "2012-03-15T20:56:20Z")

</div>

Hello, everyone.

It’s been awhile since my last announce, it was 1.1.11.1 roughly two  
months ago. And now it’s 1.1.17.1.

There were couple of bugfixes and new features. But most of the work  
was done on automated testing to make it work properly on things like  
cpantesters and travis-ci.

```
http://matrix.cpantesters.org/?dist=Nginx-Perl%201.1.16.1

```

So, it is now possible to use Nginx::Perl as a dependency for perl  
modules and test against it on cpantesters and travis-ci. Here’s an  
example of such module and its tests:

```
http://matrix.cpantesters.org/?dist=Nginx-HTTP
https://github.com/zzzcpan/Nginx-HTTP/tree/master/t

```

Also wanted to mention one example, just to show how much you can do:  
“In nginx-perl every request object $r is created and destroyed with  
nginx’s own request. This means, that it is possible to reorder  
natural request flow in any way you want. It can be very helpful in  
case of DDOS, unusual load spikes or anything else you can think of.”

```
http://zzzcpan.github.com/nginx-perl/Nginx.html#REQUEST_QUEUE
https://github.com/zzzcpan/nginx-perl/tree/master/eg/requestqueue

```

Webpage:  
[http://zzzcpan.github.com/nginx-perl/](http://zzzcpan.github.com/nginx-perl/)

Github:  
[GitHub - zzzcpan/nginx-perl: Full-featured perl support for nginx](https://github.com/zzzcpan/nginx-perl)

CPAN:  
Nginx::Perl

Changes:  
[https://raw.github.com/zzzcpan/nginx-perl/master/CHANGES.perl](https://raw.github.com/zzzcpan/nginx-perl/master/CHANGES.perl)

---

<div class="post-metadata">

**Author:** ![Alexandr\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@Alexandr\_G](https://www.ruby-forum.com/u/Alexandr_G)\
**Post date:** [March 20, 2012, 5:44pm UTC](https://www.ruby-forum.com/t/nginx-perl-1-1-17-1/217906/2 "2012-03-20T17:44:05Z")

</div>

Hello Alexander,

I’ve one simple question, how is performance affected when opening a  
small text file (a small database).

I know if the file is small linux itself will cache into memory the  
file, but I’m worried about how it will affect each url request to  
open the file, even from memory reading again the whole file, then  
querying, then closing the handler, etc. All in vain because this file  
won’t change more than once per hour.

My question is:  
There is any way to store information in memory to use between  
different requests within perl?

Thank you,

Guzmn  
On Thu, Mar 15, 2012 at 4:55 PM, Alexandr G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> natural request flow in any way you want. It can be very helpful in  
> [GitHub - zzzcpan/nginx-perl: Full-featured perl support for nginx · GitHub](https://github.com/zzzcpan/nginx-perl)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)  
> –  
> Guzmn B. Nez  
> Senior Perl Developer / Sysadmin  
> Web: [http://guzman.braso.info](http://guzman.braso.info)  
> Mobile: +598 98 674020

---

<div class="post-metadata">

**Author:** ![Alexandr\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@Alexandr\_G](https://www.ruby-forum.com/u/Alexandr_G)\
**Post date:** [March 20, 2012, 6:12pm UTC](https://www.ruby-forum.com/t/nginx-perl-1-1-17-1/217906/3 "2012-03-20T18:12:45Z")

</div>

> My question is:  
> There is any way to store information in memory to use between  
> different requests within perl?

There is just one interpreter instance per worker. So every variable  
outside of the handler’s scope is persistent across multiple requests.

```
my %cache;
my $count = 0;

sub handler {
    my ($r) = @_;
    ...
    $count++;
    ...
    my $uri = $r->uri;
    if ($cache{$uri}) {
        ...
    }
}

```

---

<div class="post-metadata">

**Author:** ![Alexandr\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@Alexandr\_G](https://www.ruby-forum.com/u/Alexandr_G)\
**Post date:** [March 20, 2012, 7:57pm UTC](https://www.ruby-forum.com/t/nginx-perl-1-1-17-1/217906/4 "2012-03-20T19:57:58Z")

</div>

That’s just great, thank you!

Then I can load the db into each worker and reload db as I wish/need.

Thank you! (again)

Guzman
