简体   繁体   English

cURL 使用 HTTP 是否比 HTTPS 快?

[英]is cURL faster with HTTP than HTTPS?

if we fire hundreds of requests in 1 second, is it better (faster) to use HTTP version of url than HTTPS ?如果我们在 1 秒内触发数百个请求,使用HTTP版本的 url 是否比HTTPS更好(更快)?

http://example.com/response.json
vs对比
https://example.com/response.json

Are there any technical reasons in the background of cURL for that? cURL的背景有什么技术原因吗?

HTTPS has overhead when compared to HTTP: in bandwidth (at the start of the connection) and in processing (encryption/decryption).与 HTTP 相比,HTTPS 具有开销:带宽(连接开始时)和处理(加密/解密)。 The latter is usually negligible since you'll almost always hit bandwidth limit before the CPU limit.后者通常可以忽略不计,因为您几乎总是会在 CPU 限制之前达到带宽限制。 The bandwidth overhead is negligible if you have long-lasting connections (either big transfers, or a persistent connection);如果您有持久连接(大传输或持久连接),带宽开销可以忽略不计; but if you open many short-lived connections, the connection overhead piles up.但是如果您打开许多短期连接,连接开销就会堆积起来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM