Welcome! Log In Create A New Profile

Advanced

Re: Subrequests and output filters

Yichun Zhang (agentzh)
August 05, 2015 11:20AM
Hello!

On Wed, Aug 5, 2015 at 7:21 PM, Maxime Henrion wrote:
> I am currently developing an nginx module in order to implement a software component in our platform.
>
> This module's responsibility is to receive upstream requests, forward them to multiple hosts (one host per pool, with N pools; we call a pool a shard), receive all the responses and aggregate them using custom application logic, and finally return an answer.
>

Seems like it's exactly what the ngx.location.capture_multi Lua API
function provided by ngx_lua does:

https://github.com/openresty/lua-nginx-module#ngxlocationcapture_multi

Your requirement can be done in just a few lines of Lua and the
performance is assured since almost all of the heavy-lifting is done
in pure C.

If you insist in rolling out your own custom nginx C modules, then I
suggest you dive into ngx_lua's internals to clone what is already
done and proven there. Having said that, I'm still strongly against
the idea of writing your own C modules after writing tens of nginx C
modules in the last 6 years myself. There won't be much gain at all as
compared to the ngx_lua approach. Not to mention all the development,
debugging, testing, and maintenance price paid on the developer side.

Well, just my 2 cents.

Regards,
-agentzh

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Subrequests and output filters

Maxime Henrion 687 August 05, 2015 07:24AM

Re: Subrequests and output filters

Yichun Zhang (agentzh) 281 August 05, 2015 11:20AM

Re: Subrequests and output filters

Maxim Dounin 318 August 05, 2015 02:56PM

RE: Subrequests and output filters

Maxime Henrion 356 August 07, 2015 07:34AM

Re: Subrequests and output filters

Maxim Dounin 299 August 07, 2015 02:02PM

RE: Subrequests and output filters

Maxime Henrion 274 August 07, 2015 02:24PM

Re: Subrequests and output filters

Maxim Dounin 317 August 07, 2015 05:48PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 140
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready