0

I have an app running on a VPS.

My server sends HTTP requests to an external API at a very high rate. This has caused me to exceed my provider's outgoing traffic limit.

My search on the internet has provided me with loads of information on how to balance incoming traffic, but my issue is outgoing traffic, on which I found minimal info, none of which I could correlate to my situation.

Purchasing a dedicated server, in order to have a higher bandwidth allowance, is not affordable for me (at least until the app becomes profitable enough, which requires it to scale up first, hence my problem).

Would the following approach solve my issue?

I keep my current server but I modify the program so that instead of performing the outgoing HTTP requests, it creates a queue, containing the data I use to form each one. I also get a few smaller VPSs, whose job is to independently and intermittently check if any requests are pending in the main servers queue. If there is a pending request to be performed, it uses the data in the queue to form and send out the corresponding request and finally when a response is received from the external API, send the HTTP response to the main server.

Note: My HTTP requests go through an external proxy service, which adds overhead to each request. Advice on minimizing the requests size could also be helpful.

It is my first time deploying an app with high traffic and my minimal knowledge of networks doesn't help. Any input would be greatly appreciated.

4
  • One option : you are going to become a privileged (often : paying) user of said API with no / fewer rate limiting constraints after reaching out to the provider of said API Commented Sep 6, 2023 at 20:59
  • If the problem is with your current providers HTTP proxy limits ; the same goes for them. -|- When their answer is NO ; move away to a hosting provider that doesn’t provide such constraints. -|- In general you can’t have unlimited resources for free and when your budget is limited; so will your resources, but not all limits are equal; a different provider may limit raw bandwidth but won’t require you to use a proxy with a request limit counter Commented Sep 6, 2023 at 21:03
  • @HBruijn The external API towards which my requests are targeted, is not causing me any issue. My problem is the outgoing bandwidth limit of my single VPS instance, set by my hosting provider. I will most likely proceed to use multiple VPS instances to take care of the issue in an affordable fashion. Commented Sep 6, 2023 at 21:37
  • Make sure to activate http compression and also shrink the http commands as much as possible, in example, remove unnessary white characters like space, return, tab and etc.. PS rethink about your business plan Commented Sep 9, 2023 at 23:12

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.