Timeout

A timeout is the time a program waits for a response before considering a request failed.

Updated · Prokso editorial team

Most programs set the connection time and the response time separately. If nothing arrives within that time, the request is cut off with a timeout error.

Residential and mobile addresses need more time than datacenter ones: the request passes through a home device or a phone. A timeout that is too short will cut off working addresses.

A timeout that is too long does harm too: the script will wait for an address that has already gone offline. With rotation it is simpler to cut the request off and repeat it with a new IP.

Causes and fixes are collected on the proxy timeout page.

Which timeouts a program has

Besides the connection and response time, many tools have a total limit for the whole request. With a proxy, the connection is opened to the gateway, which is usually quick, and most of the waiting happens in later steps: while the gateway reaches the site through the exit address and while the site responds.

ToolConnectionResponse or whole request
curl--connect-timeout 10--max-time 60, the whole request
Python requeststimeout=(10, 30), first numbersecond number, waiting for data

The second number in requests is not a limit on the whole download but the longest pause between portions of data. A large file can take longer to download without a timeout, as long as data keeps arriving.

A timeout is not the same as code 504

A timeout means that your program got no answer at all within the time it set. Code 504 is an answer: the proxy reports that the site did not respond in time. In the first case look at your limits and your network, in the second at the site and the exit address; see the 504 error page.

How to retry requests after a timeout

On ports 823 and 824 a retry goes out with a new IP, so one or two attempts with a short pause usually make sense. On a sticky IP port the retry goes through the same address; if the device has left the network, the port receives a new IP of the same country. Limit the number of retries so that a script does not loop on a site that is down.

Too many threads at once also cause timeouts. One plan allows up to 1000 concurrent connections, but it is better to raise the number gradually. Timeout options in curl are covered in the curl guide.

FAQ

What timeout should I set for residential proxies?

A longer one than for datacenter proxies: the request goes through a home device. Find the value with test requests and do not set it too low.

What should I do if timeouts are frequent?

Check the line in the proxy checker, reduce the number of threads and choose a country closer to the site.

Residential $1.59, mobile $2.50, datacenter $0.65 per GB

Sign up in a minute, get access right after payment.

Create account