Deployment automation of memcached-lite service on Google cloud VMs
- Make sure GCP SDK is installed along with GCP Beta SDK (for linking projects with billing account)
-
Contains initial values for network, firewall, server name, client name, zone and scripts path.
Modify the config file as you require.
-
gcloud web authentication
-
Project creation/selection and then setting the current project to default configuration
-
API enabling – cloudresourcemanager and compute
-
VPC/Network creation
-
Firewall opening for tcp,udp,icmp and tcp:22,tcp:3389 ports
-
Two VM creation along with startup script (metadata.sh) for library installation
-
Waiting for startup scripts to finish on each VM
-
Server code Installation/Copying from local machine
-
Client code Installation/Copying from local machine
-
SSH into client and server VMs and unzipping code
-
Server startup
-
Client testing – performs 4 client tests
-
Copying server and client logs from VM to local machine
-
VM Shutdown/Stopping
-
create.sh
-
cleanup.sh
Resource cleanup – Deletes VM, Firewalls, and Network in that order
-
Virtual Machines
- n1-standard-1 (1 vCPU, 3.75 GB memory) => $0.04749975 per hour * 2
-
Network
-
Ingress traffic => No charge for ingress traffic
-
Egress to the same Google Cloud zone when using the internal IP addresses of the resources1 => No charge
-
-
Firewall
- 500 or fewer attributes in the policy (standard) => $1 per VM covered by the policy
There are two VMs which uses the firewall and hence it will cost $2 per month.
All results can be found in the output-logs folder along with server logs after script execution
-
100 simultaneous connections to server and closing them afterwards (CONNECTION TEST)
Test 1 Execution Time: 61743.148051 milliseconds
-
100 connections to server and each perform 1 write and then 1 read
Test 2 Execution Time: 61758.51037199999 milliseconds
-
1 client writes to 1 key every 0ms and another client reads from the same key every 0ms for 100 times (Performance + Concurrency test)
Test 3 Execution Time: 2175.790368999995 milliseconds
-
2 clients write to same key at the same time for 500 times (Concurrency test for DB and multiple requests from a single client test)
Test 4 Execution Time: 4209.0177080000285 milliseconds