Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

port to plain old C++ #10

Open
peter-leonov opened this issue Nov 28, 2009 · 5 comments
Open

port to plain old C++ #10

peter-leonov opened this issue Nov 28, 2009 · 5 comments

Comments

@peter-leonov
Copy link
Owner

reread those great books about C++ and port all the module to it

@brylie
Copy link

brylie commented Jan 27, 2015

Is this still in progress? If so, what would help this to be completed?

@peter-leonov
Copy link
Owner Author

Nope. Developers would definitely help.
By the way, how do you actually use the project which is 6 years old?

@brylie
Copy link

brylie commented Jan 28, 2015

There is a project called API Umbrella that is planning to rewrite its Node.js backend using Lua/nginx. The primary developer has described the plans/considerations in detail, mentioning a few positives and negatives. One of the potential drawbacks is that the Lua ecosystem does not seem as active as the JavaScript ecosystem in some regards, specifically async libraries.

My interest is to see if JavaScript might be a viable option for the rewrite, and I have found some mention that nginx plans to natively support JavaScript. So, in the meantime, I am curious if your ngx_http_js might be a stepping stone to rebuild API Umbrella gatekeeper as an nginx integrated app.

@peter-leonov
Copy link
Owner Author

Ok, I think I've got the point of the proposed architecture.

My experience tells me that the best skill of nginx as a frontent server is it's scalability and stability. Adding thick JS engine not built for server-side usage, adding shared heap with garbage collector, adding JS libraries with crazy quality, adding purely written JS + C code + network code modules, adding all of this to nginx one can easily break the two mentioned advantages.

It is always better write simple nginx modules which send simple HTTP/FCGI request to a cluster of decision making fat Umbrella. Then the Umbrella server can send back simple instructions the nginx module should easily follow. It may even be a portion of Lua code, or a byte code for a simple stack based VM nginx already has.

@peter-leonov
Copy link
Owner Author

It might be strange to hear such things from a developer of this kind of module, but this is life. My opinion as also based on Igor Sysoev's answers and his own experiments with JS engines. Native to nginx the Perl module never got out of beta because of Perl too like to just core dump on OOM killing nginx worker process with thousands of requests in memory, ruining shared memory, locks, etc.

Better try to spare few developers to make a C++ wrappers for native nginx structures/objects and then easily write small and reliable modules, which is easy as nginx is very flexible and is buit as a set of modules.

In the end, yes, I'm a microkernel adopt :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants