Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP, 408 Request timeout

Tags:

I have an application, written in C++. This app dispatches a certain info to a script located on a remote website using HTTP POST requests. The app sends requests with a period from several seconds to several minutes.

The problem is that after about a half an hour of working without errors, the app starts to get a 408 Request timeout error from the web server. Then the app starts to retry posting but the server keeps on responding with 408 Request timeout.

An interesting observation: the error disappears after I access the website using a browser and the app works OK for about 30 minutes after that, then the issue comes back.

What could be the reason and is there any workaround to this?

PS: the app works on a usual PC with XP Workstation. The website is on GoDaddy web server.

thanks in advance

like image 682
CITBL Avatar asked Nov 03 '09 14:11

CITBL


People also ask

How do I fix a 408 request timeout?

How to Fix the 408 Request Timeout Error. Retry the web page by selecting the refresh button or trying the URL from the address bar again. Many times a slow connection causes a delay that prompts the 408 Request Timeout error, and this is often only temporary. Trying the page again will typically be successful.

What is a 408 request timeout?

The HyperText Transfer Protocol (HTTP) 408 Request Timeout response status code means that the server would like to shut down this unused connection. It is sent on an idle connection by some servers, even without any previous request by the client.

What causes HTTP timeout?

If the server takes so long to respond, a timeout error displays. This error is meant to prevent devices from waiting ceaselessly for the server to respond. The possible causes may be a server issue, outdated browser and cache, blacklisted sites, sporadic internet connection, faulty extensions, etc.


1 Answers

I know this is an old post but thought this might help someone since this problem cause me hours of frustration.

I was experiencing the same issue with a GoDaddy webserver. My Android app sent POST requests to the server and would work as expected but I started experiencing 408 Request timeout errors after 30 mins or so. I also noticed that the problem went away if I opened up a browser and opened my home page (PHP Wordpress site) from a PC or the Android device. The website was in test so web traffic was minimal and I was able to confirm this behaviour in the server logs fairly easily.

I logged a support call to GoDaddy but whilst their staff were responsive and helpful, they did not provide any useful information to explain the behaviour.

I was however able to work around the issue by simply executing a dummy GET request before my POST request and this 'woke up' the web server and it responded to all subsequent POST requests.

like image 183
DK2 Avatar answered Sep 20 '22 07:09

DK2