Queue Cfhttp Request

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Queue Cfhttp Request

    Hi,

    I'm dynamically retrieving data, for one of my (public) web page, via a
    cfhttp/get request.

    The issue is that the data provider has a limit of one request per second.
    There's no limiting algo on their end, i'll just get a "penalty" notice.

    So... is there anything I can do to limit/queue my requests to one per second?

    Thank You

    tml65 Guest

  2. Similar Questions and Discussions

    1. ASP IIS Request queue
      We have recently found that our ASP application located on a virtual directory on IIS6 Windows Server 2003 is only processing one page at a time,...
    2. CFMX7 and JMS Msg Queue
      I have a perl script that i need to run in a single threaded manner. the hardware it communicates with will not allow multithreading of anykind....
    3. Digitally Sign CFHTTP Request
      Does anyone have experience "digitally signing" an outbound CFHTTP request. We are in the process of integrating with a vendor and they are...
    4. SMTP Queue.
      G'day to all. Small problem (I think). Synopsis: 1) Win2K server with IIS and SMTP (BOX1), 2) Exchange 2K on seperate box (BOX2, 3) DNS...
    5. udp input queue
      Hello I'm debugging an application than listens on an UDP (unprivileged) port and I'm suspecting a queue buildup at certain peak load times. I...
  3. #2

    Default Re: Queue Cfhttp Request

    You could create a time loop which gets the current time and increments each
    second comparing the current time to the know next time. You could create a
    scheduled job, though, that's going to be a hefty load hitting the server. HTH


    ianwinter Guest

  4. #3

    Default Re: Queue Cfhttp Request

    Hi,

    Your first suggestion looks interesting. Would you store the "last accessed/next accessible" value in an Application variable?

    Thanks Ian
    tml65 Guest

  5. #4

    Default Re: Queue Cfhttp Request

    Yeah, you could store it anywhere really, application, session, request depends on how the application is used really.

    HTH


    ianwinter Guest

  6. #5

    Default Re: Queue Cfhttp Request

    Looks like it'll be application then. This is mainly to deal with bots, like
    googlebot, indexing my site with a surge of requests. Otherwise, with "human"
    traffic, it's not going to be likely I get two page requests within one second.

    Thanks again Ian,

    Tuan

    tml65 Guest

  7. #6

    Default Re: Queue Cfhttp Request

    Simplest solution (not necessarily the best one) is something like this:

    CFLOCK SCOPE='SERVER'
    SLEEP 1 sec
    CFHTTP


    Mr Black Guest

  8. #7

    Default Re: Queue Cfhttp Request

    Hi Mr. Black,

    I just want to confirm, your suggestion would effective stop cfml processing on the server (for a second), and then resumes the cfhttp?

    Thanks
    tml65 Guest

  9. #8

    Default Re: Queue Cfhttp Request

    No all other pages/code will run. It will just prevent other pages to issue
    CFHTTP. Perhaps a better approach will be: CFLOCK name='somename' timeout=n
    SLEEP 1 sec CFHTTP /CFLOCK Where 'n' is the number of CF threads multiplied by
    the time needed to process CFHTTP + 1 sec. You can just use a large enough
    number here. So, if you access the URL only using CFLOCK with this 'somename',
    it will guarantee that HTTP requests are not issued more often that 1 req per
    sec. You also need to implement SLEEP for 1 sec. There are some tags/tools
    that do this better that just use CFLOOP (CPU wasting time approach). Like
    this one: [url]http://www.cftagstore.com/tags/cfxexec.cfm[/url]

    Mr Black Guest

  10. #9

    Default Re: Queue Cfhttp Request

    Thanks for the clear run down, I think i got it.

    The crucial thing here is the "name" attribute, reading the documentation it
    looks like this is the exact solution i'm looking for:

    "Permits synchronizing access to resources from different parts of an
    application."

    Thanks again,

    Tuan

    tml65 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139