Rewrite lookup via MySQL table

bvidinli bvidinli at gmail.com
Mon Aug 30 14:32:20 MSD 2010


 I am new to nginx,
 but, as far as I know,
 nginx is known to be a fast light webserver.

 So, having each rewrite to be looked up in a mysql table seems
 something very slow idea.
 rewrite is something to be done on the fly, as fast as possible. and
 putting a mysql layer in this process seems not a good idea.

On Mon, Aug 30, 2010 at 1:31 PM, bvidinli <bvidinli at gmail.com> wrote:
> I am new to nginx,
> bug, as far as I know,
> nginx is known to be a fast light webserver.
>
> So, having each rewrite to be looked up in a mysql table seems
> something very slow idea.
> rewrite is something to be done on the fly, as fast as possible. and
> putting a mysql layer in this process seems not a good idea.
>
>
> On Mon, Aug 30, 2010 at 6:20 AM, agentzh <agentzh at gmail.com> wrote:
>> On Sat, Aug 28, 2010 at 8:54 PM, relix <nginx-forum at nginx.us> wrote:
>>> First of all, this thread contains a lot of information! I'm in the
>>> process of implementing something similar and it has helped me a ton.
>>>
>>> I was just wondering, as long as you're using Lua anyway, why not do
>>> away with Drizzle completely, and just make Lua connect to the database
>>> to retrieve the correct URL?
>>
>> Lua's database library will block the nginx process which is
>> unacceptable for real world applications. ngx_drizzle is served as a
>> non-blocking mysql driver component for Lua here (of cause, it can
>> also work with ngx_http_js_module and others).
>>
>>> Is it because Drizzle will keep one
>>> connection to the database per nginx-instance, so there is less
>>> overhead,
>>
>> Actually ngx_drizzle can keep connection pools to mysql backends per
>> nginx instance. One db connection per process is the suboptimal
>> PHP/Perl way of doing things and it can waste a lot of database
>> resources.
>>
>>> compared to Lua which would have to connect and disconnect to
>>> the database for every request?
>>>
>>
>> MUCH more than just that ;)
>>
>> Cheers,
>> -agentzh
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>>
>



More information about the nginx mailing list