Nginx module development practice with blocking call
António P. P. Almeida
appa at perusio.net
Mon May 14 19:47:54 UTC 2012
On 14 Mai 2012 13h21 CEST, goelvivek2011 at gmail.com wrote:
> 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 nginx:
> 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
> 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 ?
I suggest you use the Lua module and speak to the SQLite DB through
Lua's sqlite driver.
Just an idea,
More information about the nginx-devel