Goal
Load testing the VX Technology Chatbot 2.0 to prove scalability
Implementation Options
1. Pub/Sub with Cloud Functions
- Can we use Pub/Sub Lite? It is at least 85% lower cost than regular Pub/Sub
- https://cloud.google.com/pubsub/lite/pricing#comparing_pricing
- Doesn't appear t support push subscriptions
The general flow would be
- Create Pub/Sub topic (https://cloud.google.com/sdk/gcloud/reference/pubsub/topics/create)
- Create Pub/Sub subscription without
--push-endpoint(https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/create) - Publish messages containing JSON blob of data to replay (https://cloud.google.com/sdk/gcloud/reference/pubsub/topics/publish)
- Publish Cloud Functions (https://cloud.google.com/sdk/gcloud/reference/functions/deploy)
- Update Pub/Sub topic with "push" delivery method (https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/modify-push-config)
- This may take several minutes as per https://cloud.google.com/pubsub/docs/admin#change_pull_push
- Clean up resources once complete
- Unpublish cloud functions (https://cloud.google.com/sdk/gcloud/reference/functions/delete)
- Remove pub/sub subscription (https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/delete)
- Remove pub/sub topic (https://cloud.google.com/sdk/gcloud/reference/pubsub/topics/delete)
Cost Estimates
| Item | Unit | Cost Per Unit | Quantity | Total | Reference |
|---|---|---|---|---|---|
| Cloud Functions | Invocations per month | $0.00 (first 2 million) $0.0000004 (after 2 million) | < 2 million | $0.00 | https://cloud.google.com/functions/pricing |
| Cloud Functions | GiB-second (Memory) | $0.0000025 (Tier 1) | |||
| Cloud Functions | GHz-second (CPU) | $0.0000100 (Tier 1) | |||
| Cloud Functions | Egress Data GiB-month | $0.00 (first 5GiB) $0.12 (after 5GiB) | < 5 GiB | $0.00 | |
| Cloud Functions | Ingress Data GiB-month | $0.00 (free) | * | $0.00 | |
| Container Registry | Storage GiB-month | $0.026 | < 1 | $0.26 | https://cloud.google.com/container-registry/pricing#storage |
| Container Registry | Network Egress GiB-month | Free? | https://cloud.google.com/storage/pricing#network-pricing | ||
| Container Registry | Network Ingress GiB-month | $0.00 (free) | * | $0.00 | https://cloud.google.com/container-registry/pricing#storage |
| Cloud Build | build-minute (e2-medium) | $0.000 (first 120 minutes per day) $0.003 (after 120 minutes per day) | < 120 | $0.00 | https://cloud.google.com/build/pricing |
| Pub/Sub | GiB-month ingestion or delivery | $0.00 (first 10 GiB) $0.04 (after 10 GiB) | < 10 GiB | $0.00 | https://cloud.google.com/pubsub/pricing |
| Pub/Sub | GiB-month storage | $0.27 | < 1 GiB | $0.27 | https://cloud.google.com/pubsub/pricing |