Ask a Question related to Macromedia ColdFusion, Design and Development.
-
tml65 #1
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
-
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,... -
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.... -
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... -
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... -
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... -
ianwinter #2
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
-
tml65 #3
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
-
ianwinter #4
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
-
tml65 #5
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
-
Mr Black #6
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
-
tml65 #7
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
-
Mr Black #8
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
-
tml65 #9
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



Reply With Quote

