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

Problems with Azure + ASP.NET + pdfcrowd API

shaunlandau wrote on 2014-04-16:
Hello folks,

All of a sudden I have started seeing intermittent issues with calls to pdfcrowd.Client convertURI method. Execution context is ASP.NET running in Windows Azure. I don't seem to have this issue when running from ASP.NET under Windows 7.

Is this a known issue? Does anyone have any suggestions to mitigate?
support wrote on 2014-04-18:
Hello,

We sent you an email regarding this issue yesterday. Do you have any update on this?
shaunlandau wrote on 2014-04-26:
Was finally able to get more detailed information by catching pdfcrowd.Error exception:

503 - Simultaneous API calls from a single IP are not allowed.

Why is such a silly restriction imposed?
support wrote on 2014-04-28:
Hello,

We restrict simultaneous API requests in order to ensure fair distribution of capacity among users.

If the API returns 503, 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)
shaunlandau wrote on 2014-04-28:
This is precisely what I'm doing. Limiting to one concurrent request seems a bit extreme though. We just went live and have our application in use by only 5 people where each would issue requests at a rate of fewer than 1 per hour but where appointment times coincidently result in concurrent requests to the pdfcrowd API. Imposing delays results in a bad user experience for my customers. Why not offer different SLA tiers? Add $X/month for each additional concurrent request capability ... add capacity as needed.
atek wrote on 2014-04-29:
We are in a similar situation and multi-user access would make life a lot easier for us. I second that recommendation!
support wrote on 2014-04-30:
Hello,

We can move you to an unlimited private API instance with the concurrency limit lifted. Please contact us at support@pdfcrowd.com for details.