# Nginx + embedded perl, timer based on signal handling

**URL:** <https://www.ruby-forum.com/t/nginx-embedded-perl-timer-based-on-signal-handling/205453>\
**Category:** NGINX\
**Created:** [April 6, 2011, 11:35pm UTC](https://www.ruby-forum.com/t/nginx-embedded-perl-timer-based-on-signal-handling/205453 "2011-04-06T23:35:13Z")\
**Posts on this page:** 1\
**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:** [April 6, 2011, 11:35pm UTC](https://www.ruby-forum.com/t/nginx-embedded-perl-timer-based-on-signal-handling/205453/1 "2011-04-06T23:35:13Z")

</div>

Hi,

I’m trying to use a perl handler to count the global number of GET/POST  
requests issued towards the server (the existing rate/connection limit  
modules are of no use to me as they are per-source).

The main problem I’m facing is not being able to reset the counter every  
second - I tried installing a timer function as the signal handler for  
SIGALRM, but when an alarm is received the worker process exists saying  
“worker process 73712 exited on signal 14”;

Is there a way to make the worker process pass SIGALRM handing to  
embedded perl?  
Are there any other ideas of how to achieve the same goal, of defining a  
function within that perl handler memory space that executes every 1  
second without blocking nginx?

Thanks!  
Yuri

Posted at Nginx Forum:

> **[Nginx + embedded perl, timer based on signal handling](https://forum.nginx.org/read.php?2,188906,188906#msg-188906)**
>
> Hi, I'm trying to use a perl handler to count the global number of GET/POST requests issued towards the server (the existing rate/connection limit modules are of no use to me as they are per-source). The main problem I'm facing is not being able to...
