Hello!
On Tue, Nov 27, 2012 at 4:10 AM, yechuah wrote:
>
> Just wondering, If I have half my application in the conf file and half in
> lua files what are good methods to keep this organised?
>
Your application can reside in a separate directory, say, ~/MyApp, and
make it contain the subdirectories like
conf/
lua/
logs/
And then start the nginx using the -p option like this:
/usr/local/openresty/nginx/sbin/nginx -p ~/MyApp/
> When should I use lua. Should i attempt to build my application wholly in
> the nginx side (using drizzle etc) for performance? Is this worth trying?
>
When you don't need Lua to do post-processing for the response data,
sticking with pure nginx upstream C module configuration in those
locations is a good idea. You just need to ensure that your nginx.conf
does not get messy with basic nginx.conf scripting.
Always benchmark before you make a decision :)
> Building the application in lua is a lot more straightforward but simple
> benchmark shows it at about half the request rate.
Are you comparing locations configured solely with ngx_drizzle with
locations with Lua + lua-resty-mysql? Can you elaborate here? Also,
have you enabled LuaJIT 2.0.0 (final) in your openresty build? Have
you enabled connection pools?
> Performance is still
> great compared to other stacks.
>
There's still a lot of room in ngx_lua for optimizations ;)
Best regards,
-agentzh