Will running Vitess in front of a single MySQL instance be worthwhile?

396 views
Skip to first unread message

Steven Edwards

unread,
May 14, 2015, 6:18:50 AM5/14/15
to vit...@googlegroups.com
For a single server, would I be able to take advantage of Vitess's row-level cache, connection pooling, and query deduping?

If so, assuming the database test is running on db1:3306, would I run docker run -d vitess/base vttablet -db-config-dba-host=db1 -db-config-dba-port=3306 -db-connect-dba-dbname=test?

Use case: use Vitess in front of an existing database for forum software written in php.

The planned layout in Docker:

- nginx
- php-fpm or hhvm (to be benchmarked)
- vitess
- MySQL/MariaDB/Percona master
- read-slave (possibly)

I plan on reading through the shell scripts in vitess/examples/kubernetes later today to see if I can figure out how to run Vitess with etcd without Kubernetes, but any help and/or nudges in the right direction would be greatly appreciated.

Best,

Steven

Anthony Yeh

unread,
May 14, 2015, 1:02:34 PM5/14/15
to Steven Edwards, vit...@googlegroups.com
You can add Vitess's rowcache, connection pooling, and query deduping to a single MySQL instance in one of two ways:

1) Use a full Vitess cluster, backed by ZooKeeper or etcd, and just put one vttablet in it.

2) Use vtocc instead of vttablet. It's a stripped-down form of vttablet that doesn't require ZK/etcd or any other Vitess components. It's meant as a standalone proxy in front of a single mysqld.

The catch for both of these is that the app needs to talk to vtocc or vttablet with the Vitess client API, which is different from the usual MySQL client API. Currently, our best-supported client/app language is Python, with Go being the second. The clients themselves are pretty simple, since they just need to make RPCs.

I started a PHP client, but got stalled due to a BSON encoding extension we use that isn't supported by the BSON codecs available for PHP. We're working on migrating from BSON RPC to gRPC (http://grpc.io), after which it'll be easy to make Vitess clients for any of the 10 languages that gRPC supports.

--
You received this message because you are subscribed to the Google Groups "vitess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vitess+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steven Edwards

unread,
May 14, 2015, 3:51:51 PM5/14/15
to vit...@googlegroups.com, curead...@gmail.com
Thank you for the detailed reply, Anthony.  I'll be postponing Vitess integration, it seems. :)

zuxiong lin

unread,
May 14, 2015, 8:48:31 PM5/14/15
to vit...@googlegroups.com
It increase latency  for one instance (MySQL server).
I think it is not good practice way . 

Sugu Sougoumarane

unread,
May 14, 2015, 11:35:02 PM5/14/15
to zuxiong lin, vitess
It depends.
For example, if you're using rowcache and are getting a high hit rate, you should see a reduction in latency.
Also, if you have 10-100k clients, MySQL consumes a lot of memory and performance deteriorates.

The best approach would be to benchmark your representative load and evaluate the results against the rest of the value-adds.

--
Reply all
Reply to author
Forward
0 new messages