In my first NuoDB blog , I explained how to deploy the NuoDB database in a Kubernetes environment using OpenEBS storage. In this post we will test the OLTP performance capabilities of NuoDB and the Continuous Availability. for the SQL workload generator we will use YCSB in a pod,the Yahoo Cloud Serving Benchmark tool.
What is YCSB?
Yahoo! Cloud Serving Benchmark (YCSB) is a framework for benchmarking database management systems.
NuoDB packaged YCSB in a convenient Docker form to permit benchmarking container-native databases such as NuoDB.
Prerequisites
Before you get started, you’ll need to have these things:
- A kubernetes cluster (1 master and 3 workers nodes) on linux instance
- Configuration of each node : 16 vCPUs - 32GB RAM - 120 GB of storage
- HELM > 3.0.x
- OpenEBS 1.4.0
- package tuned installed
- NuoDB 4.x installed
Architecture
I will use the following architecture :
Install and start the YCSB SQL workload benchmark tool
By default, the YCSB container will create 10 connections to your database and each connection will run 10K SQL statements with a mix of 95% reads and 5% updates, then disconnect, and start a new connection, and so on.
Deploying the YCSB Pod :
Verify the pods are running :
After a few minutes of running the pod we can see the execution load in NuoDB Insights. In the example below , with a single NuoDB TE and single YCSB app running, NuoDB is processing 19K SQL TPS and the TE is running at about 26% CPU.
Next, add another YCSB application (which will double the SQL workload) by running the following command:
Verify the pods are running :
With NuoDB, you can scale out and scale back your processes with no interruption to the application. To scale the TEs, run the following command:
The graph below shows us that both TEs are now handling the YCSB SQL workload equally, 20k SQL TPS each.
You can take this benchmark further by running multiple YCSB applications, and scaling up the TE processes. You will notice that the results are stable and NuoDB scales well
Continuous Availability
To demonstrate NuoDB’s resilience to failure and continuous availability, remove a running Transaction Engine (TE) container to simulate a hardware failure or reboot one of the nodes …. You can see that the SQL load will be redistributed to the remaining TE. This type of resilience is also available for administration services and storage managers. To remove a TE engine, just type this command :
In our kubernetes configuration we already have resiliency, as we had already managed the desired number of TEs. So if a process is lost for any reason, the container management system will restart it in just a few seconds. That’s why we set the number of TEs set to 1.If we had killed the pod: te-database-nuodb-cluster0-demo-68fddff796-5xdxx , the orchestration process would have automatically started another TE process.
The graph below shows that the number of TEs has decreased to one and the remaining TE is still processing SQL transactions. The aggregate TPS has remained the same and that the application continues to run even though NuoDB has lost one of its TEs.
Conclusion
We saw how the client load is shared when scaling the number of TEs and how the client application was able to recover and continue without data loss when one of the TEs was deliberately shut down. This reactive scalability shows how NuoDB provides continuous availability, even in the event of hardware, network or other failures. When NuoDB is deployed on multiple hosts (one for each engine), application performance can improve dramatically.
However, the community edition has one limitation. If we repeat the last test, but shut down the SM instead, the application will fail because there is no second SM to take over. NuoDB Enterprise Edition removes this restriction by allowing as many TEs and SMs as you want.
Resources :
Yahoo! Cloud Serving Benchmark (YCSB)