Feature requestED: monitoring Nginx from the outside

Manlio Perillo manlio_perillo at libero.it
Thu May 1 13:39:50 MSD 2008


François Battail ha scritto:
> Manlio Perillo <manlio_perillo at ...> writes:
> 
>> But the purpose of this module is to make these variables available from 
>> an external client, right?
> 
> Not really available, but sampled to make statistics.
>  
>> However if the external client and Nginx do not synchronize the access 
>> to the shared memory, then the client will potentially read wrong values.
> 
> I don't think so. Each variable will be correct and is not supposed to be
> related to another one (this is a false assertion if your point of view is
> debugging). 

Each variable will be correct, but since you are writing the value to a 
shared memory location not atomically, the variable as read by the 
client will not be correct.

> The script will run for example with a cycle of 10 s (as collectd
> did) to give trends, no more, no less.

This is, IMHO, wrong in principle.
First of all it does not matter if the example read the shared memory 
each 10 s.

It can happen that when the client is reading the shared memory, Nginx 
concurrently writes this memory.


Moreover it really does not make sense to write in a shared memory if 
you want to support monitoring tools!

Just write a module like the stub_status module!


Finally there is one last problem.
Nginx uses only a few shared variables (the one handled the the 
stub_status module).

All other variables are private to each worker process.
This means that probably your shared memory location will contain values 
not very useful.

> Then it's up to you to read the log to search for correlation if trends are
> curious, it's just monitoring! But (I hope) it may be a good help for people
> having many servers running Nginx.
> 
> Best regards.
> 


Regards  Manlio Perillo





More information about the nginx mailing list