# Q : Nginx with libevent

**URL:** <https://www.ruby-forum.com/t/q-nginx-with-libevent/206078>\
**Category:** NGINX\
**Created:** [April 21, 2011, 9:43pm UTC](https://www.ruby-forum.com/t/q-nginx-with-libevent/206078 "2011-04-21T21:43:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 21, 2011, 9:43pm UTC](https://www.ruby-forum.com/t/q-nginx-with-libevent/206078/1 "2011-04-21T21:43:37Z")

</div>

Hi,  
I am trying to use nginx load balancing with an http server running on  
top of libevent. Because nginx makes connection requests in round  
robin fashion I am seeing a strange behavior when one of the http server  
is running a long query against backend database. What I am seeing is  
nginx picks this particular server and the request from client blocks on  
the call until the server comes back and entertains the request. Is  
there a way I can tell nginx to not use a connection when there’s  
already a pending request ? I guess BIG IP does something similar where  
you can pick LRU algorithm and it will skip over active connections  
until we exhaust every server in the pool.

Thanks,  
Kashyap
