0

Hello I recently tried Bing API v7 from India and it takes around 1.5 seconds at avg , then I tried from Singapore and London and the avg was 1.1 seconds , can you suggest me optimization tips , I am using curl php 7 , and also the best location for the server

  • Hi there, This could be caused by limited bandwidth from your location. Does API V5 return the same time duration as well? Could you provide more info about the best location for the server ? What is it going to do? Serve Web requests ? – Adam Smith - Microsoft Azure Jan 02 '18 at 17:54
  • Nearly yes, I have 1gbps server , it will server the web request. I am using the php 7 curl and –  Jan 02 '18 at 17:55

1 Answers1

0

I see, so i've searched around and found that this could also be caused by PHP 7 causing a high load on the server's CPU, if you're on a linux platform, try using the bellow commands: echo never > /sys/kernel/mm/transparent_hugepage/enabled echo never > /sys/kernel/mm/transparent_hugepage/defrag This is the full post: cURL is very slow on PHP 7 but not PHP 5

can you suggest me optimization tips , I am using curl php 7 , and also the best location for the server:

I'd suggest considering the use of a CDN, especially if you are using your app on a global level:

"APIs and developer tools give you the performance, reliability, and security you need to build global applications. Programmatic access gives customers flexibility to optimize features to provide the highest levels of availability and performance.Speed matters. Content Delivery Network sends audio, video, applications, images, and other files faster and more reliably to customers by moving content closer to your users, which gives your users an improved experience." More info can be found here:https://azure.microsoft.com/en-us/services/cdn/

  • Hi thank you for your answer but I tried php 5 and also python and also a direct curl call from root , but no diff, the latecny sticks around 1-2sec if i am doing from Virgina server then it's around .7 to .8 sec which is the most optimized I have see yet, and in terms of cdn I will surely go ahead with that but if the latecny is slow from Virgina how can i expect that from global points like Asia etc... and also i have 128gb in server with around 100gb free and i tried to connect to other api and services and those were really fast –  Jan 02 '18 at 18:10
  • you're welcome, the latency could be caused by the local traffic in specific regions, doing additional troubleshooting such as traceroute tcp pings and such would give you an idea if it's network related. CDN would shorten the time on the requests when creating edge servers based on regions you see slow performance in: https://docs.microsoft.com/en-us/azure/cdn/cdn-overview A good test also would be using another API to check if the latency is still the same or not, just to make sure it's not indeed the networking in bandwidth(Path to get to the source, not necessarily from your end). – Adam Smith - Microsoft Azure Jan 02 '18 at 18:17
  • Hi thanks, can you suggest me servers which i should use and also what is the avg latency of bing web search 7 api so that i can double check as of testing ..... –  Jan 02 '18 at 18:19
  • I couldn't find any specific documentation about the API V7 latency, however there are ways to do this testing, a detailed blog has a lot more answers:https://www.3scale.net/2015/04/how-to-load-test-and-tune-performance-on-your-api-part-i/ Including additional suggestions about what specs to use for servers. – Adam Smith - Microsoft Azure Jan 02 '18 at 18:54