Skip to content

Commit 5f10697

Browse files
author
markzegarelli
authored
Add information about HTTP API batch request size limits (#2453)
1 parent 37a7ff4 commit 5f10697

File tree

10 files changed

+31
-1
lines changed

10 files changed

+31
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div class="premonition warning"><div class="fa fa-exclamation-circle"></div><div class="content"><p class="header">HTTP Tracking API limits</p><p>Segment’s HTTP Tracking API accepts batch requests up to <strong>500kb</strong>. To avoid errors in event creation, ensure that individual event payload sizes remain below <strong>32kb</strong>.</p>
2+
3+
4+
</div></div>

src/connections/sources/catalog/libraries/server/go/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ By default, our library will flush:
378378

379379
There is a maximum of `500KB` per batch request and `32KB` per call.
380380

381+
{% include content/tracking-api-limit.md %}
382+
381383
Sometimes you might not want batching (eg. when debugging, or in short-lived programs). You can turn off batching by setting the `FlushAt` argument to `1`, and your requests will always be sent right away.
382384

383385

src/connections/sources/catalog/libraries/server/go/v2/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ By default, our library will flush:
324324

325325
There is a maximum of `500KB` per batch request and `32KB` per call.
326326

327+
{% include content/tracking-api-limit.md %}
328+
329+
327330
Sometimes you might not want batching (eg. when debugging, or in short-lived programs). You can turn off batching by setting the `FlushAt` argument to `1`, and your requests will always be sent right away.
328331

329332

src/connections/sources/catalog/libraries/server/http-api/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ The `batch` method lets you send a series of `identify`, `group`, `track`, `page
264264

265265
There is a maximum of `500KB` per batch request and `32KB` per call.
266266

267+
{% include content/tracking-api-limit.md %}
268+
269+
267270
Here's the what the `batch` request signature looks like:
268271

269272
```

src/connections/sources/catalog/libraries/server/java/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ Every method you call **does not** result in an HTTP request, but is queued in m
357357

358358
There is a maximum of `500KB` per batch request and `32KB` per call.
359359

360+
{% include content/tracking-api-limit.md %}
361+
362+
360363
## How do I flush right now?!
361364

362365
You can also flush on demand. For example, at the end of your program, you'll want to flush to make sure there's nothing left in the queue. Just call the `flush` method:

src/connections/sources/catalog/libraries/server/net/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,9 @@ By default (in async mode), this library starts a single seperate thread on init
400400

401401
There is a maximum of `500KB` per batch request and `32KB` per call.
402402

403+
{% include content/tracking-api-limit.md %}
404+
405+
403406

404407
### How do I turn batching off?
405408

src/connections/sources/catalog/libraries/server/php/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,9 @@ If your servers are handling more than 20 requests per second, you may want to l
402402

403403
There is a maximum of `500KB` per batch request and `32KB` per call.
404404

405+
{% include content/tracking-api-limit.md %}
406+
407+
405408
The lib-curl consumer is Segment's default PHP library, although you may still initialize it explicitly and set queue and batch sizes in the library's initialization settings.
406409

407410
```php

src/connections/sources/catalog/libraries/server/python/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ By default, our library will flush:
510510

511511
There is a maximum of `500KB` per batch request and `32KB` per call.
512512

513+
{% include content/tracking-api-limit.md %}
514+
515+
513516
### What happens if there are just too many messages?
514517

515518
If the module detects that it can't flush faster than it's receiving messages, it'll simply stop accepting messages. This means your program will never crash because of a backed up analytics queue. The default `max_queue_size` is `10000`.
@@ -678,7 +681,8 @@ If you're having issues with threads outliving your request, check [Background t
678681

679682
### Request Size Limits
680683

681-
Keep in mind that we have a size limit of `32KB` per request and `500KB` per batch request!
684+
{% include content/tracking-api-limit.md %}
685+
682686

683687
{% include content/troubleshooting-intro.md %}
684688
{% include content/troubleshooting-server-debugger.md %}

src/connections/sources/catalog/libraries/server/ruby/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ By default, our library will flush:
414414

415415
There is a maximum of `500KB` per batch request and `32KB` per call.
416416

417+
{% include content/tracking-api-limit.md %}
418+
417419
The queue consumer makes only **a single outbound request** at a time to avoid saturating your server's resources. If multiple messages are in the queue, they are sent together in a batch call.
418420

419421
You can specify the following additional options to determine how the queue operates and to help debug possible errors. None of them are required for normal operation.

src/connections/sources/catalog/libraries/server/rust/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ leaving the flushing of Messages up to you to implement.
377377

378378
There is a maximum of `500KB` per batch request and `32KB` per call.
379379

380+
{% include content/tracking-api-limit.md %}
381+
382+
380383
## Troubleshooting
381384

382385
{% include content/troubleshooting-intro.md %}

0 commit comments

Comments
 (0)