ecmascript module

Chris Farmiloe chris at oxdi.eu
Mon Jan 19 17:38:08 MSK 2009


Thanks! I'll take a look



On 19 Jan 2009, at 14:08, Igor Sysoev wrote:

> 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.
>
>
> -- 
> Igor Sysoev
> http://sysoev.ru/en/
>






More information about the nginx mailing list