Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Token Aware Routing #54

Open
lordnynex opened this issue Apr 24, 2015 · 3 comments
Open

Support Token Aware Routing #54

lordnynex opened this issue Apr 24, 2015 · 3 comments

Comments

@lordnynex
Copy link
Contributor

I'm currently experiencing a serious performance issue with the coordinator node becoming unresponsive due to a huge influx of WHERE IN() queries.

My current approach is to break the WHERE IN query into multiple selects, however, I'd be able to

  • Direct the queries at the appropriate node
  • Leverage WHERE IN as long as it was directed at the appropriate node.

As an additional question, do you have any strategies for dealing with async queries within openresty? It seems like there is a pretty serious performance cliff without the ability to fire multiple async queries.

@jbochi
Copy link
Owner

jbochi commented Apr 25, 2015

Unfortunately there is no way to specify a load balancing policy (issue #21). I think this is the main drawback of this driver.

Regarding async queries, the driver uses the openresty's cosocket api, so the calls do not block nginx, although they are synchronous. Async queries would be an advantage if you want to fire multiple queries in parallel for a single request. There is another open issue for supporting that: #3.

It would be nice if the driver could automatically split one WHERE IN query into multiple selects (one query for each node), but I would go for that only if there is an available implementation of this feature in one of datastax's official drivers. Do you know if any other driver does that?

@lordnynex
Copy link
Contributor Author

What about doing something like Batch where the select queries are done within coroutine.wrap? At this point I think there may be some socket problems but I think it may be possible? Also, I know there is a patch coming to use cosockets across lightthreads but I don't know when it will be merged.

@jbochi
Copy link
Owner

jbochi commented Apr 26, 2015

Running queries inside coroutines would not help because the driver reads the query results synchronously. Nginx is not blocked because of cosocket api's magic. The easiest solution is to fix issue #3, allowing several queries / streams on the same connection. If you are doing a single query for each request, you don't need to worry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants