fix: increase default flush interval#672
Merged
Merged
Conversation
5 tasks
Contributor
|
Reviews (1): Last reviewed commit: "fix: increase default flush interval" | Re-trigger Greptile |
Member
Author
|
@PostHog/team-client-libraries @cat-ph |
cat-ph
approved these changes
Jun 16, 2026
Contributor
posthog-python Compliance ReportDate: 2026-06-16 13:42:58 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
5 tasks
dustinbyrne
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
The Python SDK currently flushes partial background batches after 500ms by default, which is much more aggressive than the other backend SDK defaults. This increases the default background flush interval to 5 seconds while keeping the existing
flush_at = 100count trigger.Default backend SDK context:
posthog-pythonbefore this PRflush_at = 100posthog-pythonafter this PRflush_at = 100posthog-dotnetFlushAt = 20posthog-goBatchSize = 250posthog-elixirmax_batch_events = 100posthog-js/posthog-nodeflushAt = 20posthog-phpbatch_size = 100; flushes on batch size/manual/destructposthog-rubybatch_size = 100; worker sends queued events immediatelyposthog-rs💚 How did you test it?
uv run python .github/scripts/check_public_api.pyuv run pytest posthog/test/test_consumer.py posthog/test/test_client.py::TestClient::test_user_defined_flush_at📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
An agent updated the Python client and consumer default flush interval from 0.5s to 5s, aligned the SDK compliance adapter default
flush_interval_msto 5000, regenerated the public API snapshot, and added a Sampo changeset. The default-values table above was gathered from the locally cloned PostHog SDK repositories to give reviewers cross-SDK context for the chosen 5s value.