This is an archived forum post. The information may be outdated. Contact us if you have any questions.

503 PDF Crowd Error and Constant Crashing!

Tigerman55 wrote on 2014-06-03:
On a page I use PDF Crowd on, I am getting a much longer load time than normal. Also, once the page finally loads it is giving me this error:

Pdfcrowd Error: [503] Simultaneous API calls from a single IP are not allowed.

I am not sure what the problem is, why is it giving me this error?

In addition, when I have been trying to load the page lately, it will just get stuck loading and crash before the webpage has a chance to load.

Also, now I am getting another PDF Crowd Error: Pdfcrowd Error: [28] connect() timed out!

What could be causing these errors?
support wrote on 2014-06-03:
Hello,

As for the timeout error, our hosting provider was experiencing latency issues earlier today. The problem is resolved now. We apologize for the inconvenience.

As for the 503 error, We rate limit the API to ensure fair distribution of capacity among users. You can learn more about the limitations here:
-- https://pdfcrowd.com/api/html-to-pdf-api/#api-ref-limitations

If your application sends multiple API requests at a time or more than 30 requests per minute, the service returns the 503 error.
If the API returns the 503 error, it is perfectly ok to sleep() for a few seconds and then resend the unsuccessful request. Unsuccessful/failed requests do not consume tokens. Here is a pseudocode example:
tries = 0
  success = False
  while not success:
     tries += 1
     try:
        call the API
        success = True
     catch (pdfcrowd.Error why):
         if tries == 5:
            some serious error, log or re-throw the exception
         else:
            sleep(1 or 2 seconds)