What should I do if curl accesses the interface deployed on an overseas server very slowly?

After delivering the loose diamond ordering system to the customer two days ago, the customer added a new requirement: an interface for him to connect with an upstream diamond supplier from India to achieve the purpose of automatic synchronization of diamond data, so that he can avoid It eliminates the trouble of uploading diamond data every day, data synchronization is timely and without deviation, and it can automatically complete the conversion of some field values, such as automatically converting RD to a circle, solving the problem of inconsistent data presentation habits.

Originally, this requirement was quite simple, but I encountered a problem at the beginning. When accessing the interface provided by the upstream supplier in the browser, the speed was normal. However, once I used curl to access it in the development environment (Tencent Cloud Server was used), It will become very laggy and slow. At first, I thought it was the interface provider who had implemented some anti-crawler mechanism. Later, I tested it in the local environment and found that it was also very fast. After analysis, it may be the GW firewall or mainland China. The computer room has inspection and filtering requirements for data coming from overseas, so the transmission speed is affected.

Let me remind you from this experience:
If your business system needs to connect to overseas data, it is best to buy a Hong Kong or overseas host, otherwise data transmission may be affected.
If the server has been deployed in China, you may consider finding a transit host in Hong Kong to solve this problem.

Guess you like

Origin blog.csdn.net/one_and_only4711/article/details/118964417