Handling Web Service Timeouts While Performing Long-Running Oracle Database Tasks - oracle

I'm having trouble with a long running webservice timing out in an Oracle 10g environment.
The client calls the webservice and after approximately 10 minutes, it receives the following response:
HTTP/1.1 503 Service Unavailable Server:
OracleAS-Web-Cache-10g/10.1.2.3.0 Content-Type: text/html Connection:
Keep-Alive Keep-Alive: timeout=600, max=999 Content-Length: 402
No
Response from Application Web Server No Response from Application
Web Server There was no response from the application web
server for the page you requested. Please notify the site's
webmaster and try your request again later.
The webservice executes a procedure in the database which takes a long time to finish (more than 20 min, on average) and the client receives the above response after aproximately 10 minutes.
My guess is that the webserver thinks the webservice has crashed, so it terminates it and sends the above response to the client.
My question is: how do I deactivate the timeout setting? I need to let the webservice run for as long as it needs (or, at least, for severeal hours).
I don't have access to the webserver's configuration or administration console but I can ask the guys responsible for managing it to change any setting (this is a test environment).
Thanks in advance for any ideas.

Related

How to solve "Response code:503 Response message:Service Temporarily Unavailable" this error?

Thread Name:Thread Group 1-1
Sample Start:2022-04-26 14:22:39 IST
Load time:230
Connect Time:159
Latency:226
Size in bytes:11283
Sent bytes:498
Headers size in bytes:797
Body size in bytes:10486
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):text
Response code:503
Response message:Service Temporarily Unavailable
HTTPSampleResult fields:
ContentType: text/html; charset=UTF-8
DataEncoding: UTF-8
As per the error description:
503 Service Unavailable
The HyperText Transfer Protocol (HTTP) 503 Service Unavailable server error response code indicates that the server is not ready to handle the request.
Common causes are a server that is down for maintenance or that is overloaded. This response should be used for temporary conditions and the Retry-After HTTP header should, if possible, contain the estimated time for the recovery of the service.
so there is nothing you can "solve" here.
If the server is down for the maintenance - you just need to wait until it's back
If the server is overloaded - congratulations on finding the bottleneck, if you want to investigate further you might want to check:
your application and middleware configuration, you might need to tune it for the high loads
your application resources consumption (CPU, RAM, etc.) as if it lacks resources you might need to migrate to more powerful hardware, it can be done using JMeter PerfMon plugin
repeat your test with a profiler tool or an APM tool telemetry enabled, this way you will be able to tell for sure where the problem is

About Jmeter Content Type -issue

While sending a https request in Jmeter prior already i have set Content-Type as "application/json" and but output still displayed as Content-Type: text/html in response header
code
HTTP/1.1 504 Gateway Time-out
Server: nginx/1.18.0 (Ubuntu)
Date: Wed, 02 Mar 2022 05:45:33 GMT
Content-Type: text/html
Content-Length: 176
Connection: keep-alive
Don't confuse request headers and response headers, they don't have to be the same.
Response status 504 means Gateway Timeout
server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request.
So most probably it indicates that your server is overloaded and cannot provide the response within the acceptable timeframe. You can already report it as the botteneck
If you want to investigate further you could:
Check your server logs
Check your server configuration it might not be suitable for high loads
Check your server resources availability in terms of CPU, RAM, Network, Disk, etc. It might be the case you have an APM solution in place, if not you can go for JMeter PerfMon Plugin
Re-run your test with profiler tool telemetry enabled, this way you will get more insights

Jersey client gets 504 when server keeps processing request

I have a Jersey client and server. And I see this behavior:
In client I post a request
In the server I see the request and start to handle it
Then out of a sudden I receive an empty response with status 504 to the client while the server still processes the request
I've set the client properties to have read and connect timeouts much higher than the time I get the empty response
After further analysis - the gateway timeout was due to a Load-Balancer between the client and the server.
Reconfiguring the timeout in the Load-Balancer solved the issue

Axis2 HTTP 400 error with VS2010 development server

I have a simple problem that I can't currently recreate and I need to solve next Monday.
In a development environment, we have a .NET4 service running on ASP.NET test server provided by VS2010 and a Java client running Axis2. We found that all requests fail. With Wireshark we found a 400 Bad request error on every request.
We found that each request from Java client required transfer-encoding: chunked. The rest seemed well formed. After the headers and a few bytes the server throws 400 error.
Questions are:
Does .NET test server support chunked transfers?
How can I tell Axis2 to use plain HTTP without even keep-alive just to be sure?
Answer 1
No, it doesn't. Disabling chunked encoding makes everything work!
Answer 2
http://wso2.org/library/209 provides information about how to disable chunked transfers (with an error in their code)
FooStub stub = new FooStub();
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);

What raises HTTP 503 and how to change timeout?

I have inherited an application (internal to my company) that uses javascript running in Internet Explorer which makes Ajax calls to a Struts-based application running in WebLogic Server v10.
Certain server-side operations in the system are taking longer than 3 minutes. Users consistently noticed that the Ajax call returns 503 error at the 3 minute mark. My users can wait longer than 3 minutes, but 503 errors interrupt their work.
This application needs to be performance tuned, but we badly need a temporary workaround to extend how much time can occur before a 503 error is returned.
The current theory is that the 503 error is being raised by the IE XMLHttpRequest object. A team of supposed WebLogic experts poured over our code and WebLogic logs, and declared that there's no timeout occurring on the server side. But I have my doubts.
My question is, which piece of software is responsible for raising 503 error: the browser, the Ajax javascript, or the server? And can this timeout period be changed?
A 503 error is kind of a catch-all for a lot of different types of errors, usually on the server side. In your case it could be that the server is just rejecting the connection after a certain timeout, and responding back with a 503 to indicate that the server is overloaded or cannot process your request.
A lot of times with web services, a 503 will be returned when the server code throws an exception or error. If the server code doesn't properly handle the error, it will bubble up to the server, which will just respond back with a generic 503.
http://www.checkupdown.com/status/E503.html
Error code 5xx (alternate definition)
RFC 2616
503 is a server error. XMLHttpRequest will happily wait longer than 3 minutes. The first thing you should do is satisfy yourself of that by visiting the problem URL in telnet or netcat or similar and seeing the 503 with javascript out of the picture.
Then you can proceed to find the timeout on the server side.
Your web server has a request reply timeout which is being tripped by long-running service requests. It could be the WebLogic server or a proxy. It is certainly not the client.
Have you considered submitting an asynchronous HTTP request that will be responded to immediately, and then polling another location for the eventual results? Three minutes is about 170 seconds too long.
503 is most likely due to a timeout on the server. If you can tune your Apache server, read about the Timeout attribute that you can set in httpd.conf.
Look in the httpd/logs/error_log to see if timeouts are occurring.
Refer also to this answer: Mod cluster proxy timeout in apache error logs .

Resources