Custom Nginx module memleaks problem

Hi all,

Recently I write a simple Nginx module ,but when I deploy it on the
product environment it will make the Nginx service crash as it takes too
many memory.The main handler code is here

http://codepad.org/2H9We02C

I’ve checked the code from time to time but still cannot solve the
problem.And I hope someone offer me some suggestions about it.

regards

Tonny

Posted at Nginx Forum:

Hi,

On Thu, Jun 21, 2012 at 9:34 AM, tonny.young [email protected]
wrote:

I’ve checked the code from time to time but still cannot solve the
problem.And I hope someone offer me some suggestions about it.

Why not use the standard memcache module or agentzh’s memc module?
They will not block as your module does and I believe there will be no
memory leak either.

Regards,

Thanks for the suggestions.Can you explain me how my module “blocks”?

Posted at Nginx Forum:

Hello!

On Mon, Jun 25, 2012 at 8:36 AM, tonny.young [email protected]
wrote:

Thanks for the suggestions.Can you explain me how my module “blocks”?

All your memcached related calls from within your content handler will
block your nginx worker processes from serving other concurrent
requests, which essentially turns your nginx server into something
like Apache’s prefork mpm.

Regards,
-agentzh

agentzh Wrote:

block your nginx worker processes from serving
[email protected]
nginx Info Page

Thanks for the explain.

Posted at Nginx Forum: