9 messages in ru.sysoev.nginxRe: ecmascript module
FromSent OnAttachments
Chris FarmiloeJan 19, 2009 6:00 am 
Chris FarmiloeJan 19, 2009 6:03 am 
Igor SysoevJan 19, 2009 6:08 am 
Chris FarmiloeJan 19, 2009 6:37 am 
Phillip B OldhamJan 19, 2009 6:41 am 
Johan BergströmJan 19, 2009 7:19 am 
Chris FarmiloeJan 19, 2009 8:44 am 
Peter LeeeeeeeeeeeeFeb 25, 2009 9:11 am 
Peter LeeeeeeeeeeeeFeb 25, 2009 3:38 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: ecmascript moduleActions...
From:Igor Sysoev (is@rambler-co.ru)
Date:Jan 19, 2009 6:08:25 am
List:ru.sysoev.nginx

On Mon, Jan 19, 2009 at 02:00:26PM +0000, Chris Farmiloe wrote:

I've started to build an nginx module to process server-side ecmascript (javascript) by embedding the spidermonkey engine. I've got a (very) rough proof of concept hacked together just now, but after about 30-50 requests the I can't allocate enough memory to build the spidermonkey runtime.

I'm new to C and just skim-read the white book to get this far so I expect I am just making naive C mistakes.

What I couldn't understand is that the same jsapi code outside of the nginx module never seemed to have the allocation issues. And if it was a memory allocation issue... wouldn't my worker processes rise above 2MB?

Sorry for the vague message, but if someone could give me a nudge in the right direction of what might be happening so I can get back to learning it would be much appreciated!

here's my example so far:

http://github.com/chrisfarms/nginx_ecmascript_module/blob/0d970a33771c4cdbec2293c5c5db9f34191e7ffa/ngx_http_ecmascript_module.c

There is already an attempt to embedd SpiderMonkey: http://www.cmsbuilder.ru/files/nginx.js/ngx_http_js_module-0.1.tgz

(and some comments in Russian): http://www.cmsbuilder.ru/blog/2008/12/07/ngx_http_js_module-01/ http://www.cmsbuilder.ru/blog/2008/11/30/nginx-js/

You may look this implementation.