I am writing nginx module which uses sqlite to do some read operation. As
sqlite read doesn't support non-blocking call(according to my knowledge).
What will be best solution to integrate it with nginx.
I am accepting near about 200 at the same time. One request takes near
about 200 ms to process. What method will be the best implementation using
1. Increasing nginx worker process count to 50-200. So I will having
enough worker to accept client request.
My concern it that will it increasing connecting time of a user on next
request as there will be less chances that same user will be served by same
nginx worker process.
2. Doing te read in a thread and using nginx event based api to send
response. So I can handle multiple client using only two or one worker
3. Moving my code to fastcgi and using nginx fastcgi module to
communicate with .
What will be the best solution for this implementation ?
Date: 2012-05-14 09:58:07 +0000 (Mon, 14 May 2012)
New Revision: 4623
Upstream: fixed ip_hash rebalancing with the "down" flag.
Due to weight being set to 0 for down peers, order of peers after sorting
wasn't the same as without the "down" flag (with down peers at the end),
resulting in client rebalancing for clients on other servers. The only
rebalancing which should happen after adding "down" to a server is one
for clients on the server.
The problem was introduced in r1377 (which fixed endless loop by setting
weight to 0 for down servers). The loop is no longer possible with new
smooth algorithm, so preserving original weight is safe.
--- trunk/src/http/ngx_http_upstream_round_robin.c 2012-05-14 09:57:20 UTC (rev 4622)
+++ trunk/src/http/ngx_http_upstream_round_robin.c 2012-05-14 09:58:07 UTC (rev 4623)
@@ -80,8 +80,8 @@
peers->peer[n].max_fails = server[i].max_fails;
peers->peer[n].fail_timeout = server[i].fail_timeout;
peers->peer[n].down = server[i].down;
- peers->peer[n].weight = server[i].down ? 0 : server[i].weight;
- peers->peer[n].effective_weight = peers->peer[n].weight;
+ peers->peer[n].weight = server[i].weight;
+ peers->peer[n].effective_weight = server[i].weight;
peers->peer[n].current_weight = 0;