Too many requests every few hours

discord
javascript
html
#1

hi
i have a problem…
i get this message in the website in my discord bot project every few hours
“This project has received too many requests, please try again later.”
my project naknak-bot
i have uptime robot to this project and this code:
setInterval(() => {http.get(http://${process.env.PROJECT_NAME}.glitch.me)}, 3600000);
i have domain: naknak-bot.tk

#2

Could you please send us your project name?

#3

@xXProGamerXx

He has already provided the project name

(@nivlol If you find it easier speaking in hebrew, then you can do so, and we will still try out best to help, because I know you sometimes struggle with english words since you mainly speak hebrew! )

#4

Hi @nivlol your project naknak-bot is showing up as rate-limited in our reports, so it is receiving more requests than what’s listed in technical restrictions.

I doubt very much that your setInterval or UptimeRobot configuration are the cause, though. If you’re using UptimeRobot as advised elsewhere that would only account for 12 of the 4000 hourly requests available. That setInterval config would only be 1 request an hour (and is pretty much pointless, to be honest - the setInterval pattern adds no value when UptimeRobot is in the equation).

One thing that can affect this is having auto-refresh turned on, especially if numerous people are editing files and all have auto-refresh on. How your bot’s site is constructed can also be a factor - if your site is built in such a way as to require a number of separate css or js files for each page load, each of those files counts as a request. Might either of those things be a factor?

#5

Oh I didn’t notice.

(more chars to satisfy Discourse)

#6

i have one css file in the project and some css lines in the files
and i have
server.js - require the files and send for the files some consts
and some api files (but one for all page that use the api)
and have 2 ejs files: nav and footer
all page it ejs file and it use more 2 ejs files

#7

Hi @nivlol, here’s what we’ve found. Your project is getting hammered a few times an hour by something originating from IP address 54.78.40.204, which is an EU West AWS IP. There are a few other projects being accessed from that IP; most of them are owned by the person you’re working with on https://glitch.com/~naknakbot-r. None of them are getting beat up like naknak-bot is though. Another interesting thing is that all the requests seem to come in exactly four times an hour, at :10, :25, :40, and :55 minutes after each hour.

Perhaps that information can help you narrow down what’s causing the issue?

#8

i know what’s causing the issue
but the person not reply to my messages
you can block his ip from glitch/do something in the requests in my project from he?

#9

I see. Sorry about that; it wasn’t clear to me you knew where the extra requests were coming from.

Glitch won’t handle this for you in this case, but you should be able to use something like https://www.npmjs.com/package/express-ipfilter to blacklist the IP the requests are coming from.

Hope this helps!

1 Like
#10

I’ve been talking this over with a colleague and I was wrong in my previous post. The express ipfilter won’t help in this case because we’re rate-limiting you before the request gets to you. Sorry for misleading you!

In this case it appears as though things may have been resolved though; is that correct?

#12

i think its ok, the ipfilter
the website not get the error over 4 hours (when i use the filter)