Pub/Sub API and Event Allocations

Check out allocations for Pub/Sub API, including the event message size, how many events you can publish and request, and how many events can be delivered to subscribers.

Check out allocations related to event publishing.

Event Message Size in a PublishRequest

We recommend that the total size of a batch of events in a PublishRequest doesn’t exceed 3 MB. The 3 MB recommendation is below the gRPC 4 MB limit and ensures optimal performance. If your PublishRequest exceeds 4 MB, the publish call fails with this gRPC error, and the server closes the stream.

Each event message in a batch in a PublishRequest has a maximum size of 1 MB. If you publish a batch of events containing an event larger than 1 MB, the PublishResult of that event contains an error, and the event can’t be published. Each event in the batch has its own PublishResult, so it can still be published if there are no errors.

Number of Events in a Publish Request

We recommend that you send no more than 200 events in one publish request for best performance results.

Platform Event Publishing Allocation

Platform events are subject to an hourly publishing allocation. For more information, see Platform Event Allocations in the Platform Events Developer Guide.

Check out allocations related to event subscription.

Number of Events Requested in a Subscribe Call

The maximum number of events that can be requested across all FetchRequests in a Subscribe call is 100. If a client requests more than 100 events, the server considers the number of requested events to be 100. The client sets the number of events to request in the num_requested field of the FetchRequest. The server adjusts the total number of requested events based on the requested events sent in one or more FetchRequests, and how many events were already delivered.

When you subscribe with the Pub/Sub API, the event delivery allocations for platform events, change data capture events, and real-time event monitoring events apply. For more information, see the documentation for each event type.