[GH-ISSUE #740] Rate limiting for upstream push notifications #540

Closed
opened 2026-05-05 04:08:47 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @nimbleghost on GitHub (May 23, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/740

Question

How is the upstream push notification request limit calculated? I see a message like this for every publish, but it doesn't look like the limit is being hit in the log nevertheless:

2023/05/23 10:02:16 WARN Unable to publish poll request, unexpected HTTP status: 429 (
	message_body_size=4,
	message_event=message, 
	message_id=<id>, 
	message_sender=<ip>, 
	message_time=<ts>, 
	topic=<topic>,
	visitor_auth_limiter_limit=0.016666666666666666,
	visitor_auth_limiter_tokens=30,
	visitor_id=ip:<ip>, 
	visitor_ip=<ip>,
	visitor_messages=442,
	visitor_messages_limit=17280,
	visitor_messages_remaining=16838,
	visitor_request_limiter_limit=0.2,
	visitor_request_limiter_tokens=59.0214558084, 
	visitor_seen=<today>
)

I had an Uptime Kuma check making sure that publish was working, so publishing about once a minute - but that shouldn't hit the rate limits in general, I believe?

Originally created by @nimbleghost on GitHub (May 23, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/740 <!-- Before you submit, consider asking on Discord/Matrix instead. You'll usually get an answer sooner, and there are more people there to help! - Discord: https://discord.gg/cT7ECsZj9w - Matrix: https://matrix.to/#/#ntfy:matrix.org / https://matrix.to/#/#ntfy-space:matrix.org --> :question: **Question** <!-- Go ahead and ask your question here :) --> How is the upstream push notification request limit calculated? I see a message like this for every publish, but it doesn't look like the limit is being hit in the log nevertheless: ``` 2023/05/23 10:02:16 WARN Unable to publish poll request, unexpected HTTP status: 429 ( message_body_size=4, message_event=message, message_id=<id>, message_sender=<ip>, message_time=<ts>, topic=<topic>, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:<ip>, visitor_ip=<ip>, visitor_messages=442, visitor_messages_limit=17280, visitor_messages_remaining=16838, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=59.0214558084, visitor_seen=<today> ) ``` I had an Uptime Kuma check making sure that publish was working, so publishing about once a minute - but that shouldn't hit the rate limits in general, I believe?
gitea-mirror 2026-05-05 04:08:47 -06:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@binwiederhier commented on GitHub (May 23, 2023):

Once a minute is too much for the upstream server (ntfy sh). The current rate limits for the free plan is 250/day, and there are 1440 minutes in a day.

You can purchase a ntfy Pro plan and set up upstream-access-token if you need more. Or you can compile and set up the iOS app yourself, of course.

<!-- gh-comment-id:1559046704 --> @binwiederhier commented on GitHub (May 23, 2023): Once a minute is too much for the upstream server (ntfy sh). The current rate limits for the free plan is 250/day, and there are 1440 minutes in a day. You can purchase a ntfy Pro plan and set up `upstream-access-token` if you need more. Or you can compile and set up the iOS app yourself, of course.
Author
Owner

@nimbleghost commented on GitHub (May 23, 2023):

Oh I see, thanks. Am I reading the logs incorrectly? If not - would it be possible to make it clearer that it's hitting this 250/day limit? (Is that based on publisher and not subscriber/visitor?).

<!-- gh-comment-id:1559100667 --> @nimbleghost commented on GitHub (May 23, 2023): Oh I see, thanks. Am I reading the logs incorrectly? If not - would it be possible to make it clearer that it's hitting this 250/day limit? (Is that based on publisher and not subscriber/visitor?).
Author
Owner

@binwiederhier commented on GitHub (May 23, 2023):

This error happens when your selfhosted ntfy server send a "poll request" to the upstream server (ntfy.sh). So your rate limits are not affected, but the upstream rate limits are exceeded.

You are right, I should make it clearer. I'll update the error message to make it clearer.

<!-- gh-comment-id:1559677139 --> @binwiederhier commented on GitHub (May 23, 2023): This error happens when your selfhosted ntfy server send a "poll request" to the upstream server (ntfy.sh). So your rate limits are not affected, but the upstream rate limits are exceeded. You are right, I should make it clearer. I'll update the error message to make it clearer.
Author
Owner

@binwiederhier commented on GitHub (May 23, 2023):

I added da06ae4485. Closing this now. Feel free to continue the discussion though

<!-- gh-comment-id:1559859681 --> @binwiederhier commented on GitHub (May 23, 2023): I added https://github.com/binwiederhier/ntfy/commit/da06ae448528b08215c69fa90de5162869ac6623. Closing this now. Feel free to continue the discussion though
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/ntfy#540
No description provided.