Re: Possible to optimise CFHTTP Response Time?
Very good question actually, we recently had networking issues on some of our vps hosts where customers were reporting the same type of issue. Low pings but slow httpîªresponses. Turns out the host nodes had traffic shaping configured which basically maxed at 1 Gb even though the physical network is all 100 Gb. During backups things simply slowed down due to the traffic shaping. Byron Mann Lead Engineer Architect HostMySite.com On Feb 19, 2014 8:45 AM, Mack mrsmith.w...@gmail.com wrote: On Thu, Feb 13, 2014 at 4:57 PM, Craig Brown craigpbr...@gmail.com wrote: I have an API running on my server where I can receive an average ping response to the host server of 1ms yet when I make a CFHTTP request to the host server it takes anywhere from 300-500ms to return a response. Are you by any chance on Amazon AWS ? Or maybe some other virtualized XEN solution ? -- Mack ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357722 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Possible to optimise CFHTTP Response Time?
On Thu, Feb 13, 2014 at 4:57 PM, Craig Brown craigpbr...@gmail.com wrote: I have an API running on my server where I can receive an average ping response to the host server of 1ms yet when I make a CFHTTP request to the host server it takes anywhere from 300-500ms to return a response. Are you by any chance on Amazon AWS ? Or maybe some other virtualized XEN solution ? -- Mack ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357690 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Possible to optimise CFHTTP Response Time?
I have an API running on my server where I can receive an average ping response to the host server of 1ms yet when I make a CFHTTP request to the host server it takes anywhere from 300-500ms to return a response. Anyone have any ideas what might be causing this latency, and how I could decrease it? From having a long read about online I think the length of time it is taking is perhaps down to each cfhttp request having to open a new https connection (although I'm passing a keep-alive connection request header) and closing the connection after each request completes? I know there's a HttpComponents library but I've only ever used CF tags so don't know if this is a possible solution to help me maintain a persistent https connection or how I'd even start going about implementing it? Do I put it inside a CFFunction, CFScript etc? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357685 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Possible to optimise CFHTTP Response Time?
From having a long read about online I think the length of time it is taking is perhaps down to each cfhttp request having to open a new https connection (although I'm passing a keep-alive connection request header) and closing the connection after each request completes? I know there's a HttpComponents library but I've only ever used CF tags so don't know if this is a possible solution to help me maintain a persistent https connection or how I'd even start going about implementing it? Do I put it inside a CFFunction, CFScript etc? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357686 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Possible to optimise CFHTTP Response Time?
I have an API running on my server where I can receive an average ping response to the host server of 1ms yet when I make a CFHTTP request to the host server it takes anywhere from 300-500ms to return a response. ... From having a long read about online I think the length of time it is taking is perhaps down to each cfhttp request having to open a new https connection (although I'm passing a keep-alive connection request header) and closing the connection after each request completes? I know there's a HttpComponents library but I've only ever used CF tags so don't know if this is a possible solution to help me maintain a persistent https connection or how I'd even start going about implementing it? Do I put it inside a CFFunction, CFScript etc? I'm not sure what you read, but it seems very unlikely to me that this is the cause of your problem. It's not going to take half a second to create a new HTTPS connection. In fact, I'm not sure you actually have a problem at all. Have you tested this API with anything else, like wget? I recommend you spend more time trying to figure out what the problem is - if there's a problem at all - before you start looking for solutions to the problem you've not yet defined. Right now, your problem definition is it's slower than I think it should be. You need to turn that into something more concrete. Dave Watts, CTO, Fig Leaf Software 1-202-527-9569 http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357687 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Possible to optimise CFHTTP Response Time?
I have an API running on my server where I can receive an average ping response to the host server of 1ms yet when I make a CFHTTP request to the host server it takes anywhere from 300-500ms to return a response. Anyone have any ideas what might be causing this latency, and how I could decrease it? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357671 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Possible to optimise CFHTTP Response Time?
a cfhttp is not the same as a ping a ping simply sends a packet to the server and gets a response. cfhttp is requesting a page from the server, that request goes to the web server, then to cf, the page has to execute and then return all data back to your server, so the time taken depends on how long the page takes to process On Thu, Feb 13, 2014 at 2:57 PM, Craig Brown craigpbr...@gmail.com wrote: I have an API running on my server where I can receive an average ping response to the host server of 1ms yet when I make a CFHTTP request to the host server it takes anywhere from 300-500ms to return a response. Anyone have any ideas what might be causing this latency, and how I could decrease it? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357672 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Possible to optimise CFHTTP Response Time?
a cfhttp is not the same as a ping a ping simply sends a packet to the server and gets a response. cfhttp is requesting a page from the server, that request goes to the web server, then to cf, the page has to execute and then return all data back to your server, so the time taken depends on how long the page takes to process On Thu, Feb 13, 2014 at 2:57 PM, Craig Brown craigpbr...@gmail.com wrote: I'm not claiming that it is but I'm surprised that it's taking so long to process such a simple request (which is returning json) and was wondering if there's a way of optimising the request... ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357673 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Possible to optimise CFHTTP Response Time?
if it is the page you are calling which is taking the time then no, because it is not the request which is the cause. A suggested you need to check how long the page you are requesting takes to execute before blaming the connection. On Thu, Feb 13, 2014 at 3:22 PM, Craig Brown craigpbr...@gmail.com wrote: a cfhttp is not the same as a ping a ping simply sends a packet to the server and gets a response. cfhttp is requesting a page from the server, that request goes to the web server, then to cf, the page has to execute and then return all data back to your server, so the time taken depends on how long the page takes to process On Thu, Feb 13, 2014 at 2:57 PM, Craig Brown craigpbr...@gmail.com wrote: I'm not claiming that it is but I'm surprised that it's taking so long to process such a simple request (which is returning json) and was wondering if there's a way of optimising the request... ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357676 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Possible to optimise CFHTTP Response Time?
I have an API running on my server where I can receive an average ping response to the host server of 1ms yet when I make a CFHTTP request to the host server it takes anywhere from 300-500ms to return a response. Anyone have any ideas what might be causing this latency, and how I could decrease it? Do you control the API service? If so, it's like any other web program, and you can optimize it the same way you would any other web program - look for unnecessary work done at runtime, etc. If you don't control the API service, there isn't a lot you can do. There might be a problem with your machine's network connection. You could try making the request from another machine on a different network and see what happens. You don't need to use CFHTTP to test this kind of thing - you can use any HTTP client, including wget etc. And, as Russ mentioned, ping and HTTP times aren't connected in any useful way. Dave Watts, CTO, Fig Leaf Software 1-202-527-9569 http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357680 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm