server timeout issue - web-services

I am using tk10x server to listen some request from a GPS device on my OpenGTS server. By default this tk10x has a timeout of 60000ms. I want to remove this timeout thing what should i do ?

Here are a few texts from: http://www.opengts.org/FAQ.html
For Tomcat
This can be changed in the Tomcat default "web.xml" file found in the Tomcat directory "$CATALINA_HOME/conf/web.xml". Here is the section of the "web.xml" file that sets the timeout to 30 minutes:
<session-config>
<session-timeout>30</session-timeout>
</session-config>
You can change this value to any desired length of time. Tomcat should be restarted after this value has been changed. (Note: setting this value too large may cause excessive resources to be consumes by users which have logged in, but are not actually using the system).
Alternative
This can be configured in the "dcservers.xml" file (or "dcservers/dcserver_XXXXX.xml" file where XXXXX is the DCS id) by setting the TCP timeout values to '0', as follows:
<Property key="tcpIdleTimeoutMS">0</Property>
<Property key="tcpPacketTimeoutMS">0</Property>
<Property key="tcpSessionTimeoutMS">0</Property>
This will cause the DCS (where the above properties were set) to always leave the TCP session open. (Note: each connected TCP connesion consumes system resources - memory, threads, filehandles, etc. Having many such connected TCP sessions may significantly limit the number of devices which can connect with your server).

Related

Limiting processing time of request for WCF or ASMX webservice

Let say I have a webservice (WCF and ASMX .net framework 4.8) which is hosted on IIS 10. Webservice has a method with this content:
public CustomerListResponse Get(CustomerListRequest request)
{
//sleep for 1 hour
System.Threading.Thread.Sleep(TimeSpan.FromHours(1));
return new CustomerListResponse();
}
The line that is performing sleep on thread is just to show that there is code that in some cases can take long time.
What I'm looking is setting or way to limit allowed processing time for example to one minute and error returned to client. I want the processing be killed by IIS/WCF/ASMX if the execution time will exceed one minute.
Unfortunately I didn't found a way in IIS for that. Also I don't have access to client code to set this limit on other side - change is possible only on server side.
What I tried:
on binding for WCF there is couple of properties openTimeout="00:01:00" closeTimeout="00:01:00" sendTimeout="00:01:00" receiveTimeout="00:01:00" - I set them all but it didn't work. Code can still process for long time.
<httpRuntime targetFramework="4.8" executionTimeout="60" /> - also didn't work
I don't have other ideas how to achieve that, but I believe there should be some solution to be able control how long we want to spend on processing.
You need to set the timeout on both client-side and server-side.
Client-side:
SendTimeout is used to initialize OperationTimeout, which manages the entire interaction of sending a message (including receiving a reply message in a request-reply case). This timeout also applies when a reply message is sent from the CallbackContract method.
OpenTimeout and CloseTimeout are used to open and close channels (when no explicit timeout value is passed).
ReceiveTimeout not used.
Server-side:
Send, open, and close timeouts are the same as on the client side (for callbacks).
ReceiveTimeout is used by the ServiceFramework layer to initialize idle session timeouts.

how to increase AmazonMQ maximum connections

2019-08-01 06:04:43,263 | ERROR | Could not accept connection :
org.apache.activemq.transport.tcp.ExceededMaximumConnectionsException:
Exceeded the maximum number of allowed client connections. See the
'maximumConnections' property on the TCP transport configuration URI
in the ActiveMQ configuration file (e.g., activemq.xml) |
org.apache.activemq.broker.TransportConnector | ActiveMQ Transport
Server Thread Handler:
nio+ssl://b-e13f27f2-1fa3-419f-819c-a24277e973a8-2.mq.us-west-2.amazonaws.com:61617?maximumConnections=100&wireFormat.maxFrameSize=104857600
Getting above exception on amazonMQ, earlier we were using activeMQ where we were setting something like
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireformat.maxFrameSize=104857600"/>
</transportConnectors>
In amazonMQ we are unable to find such options and broker is throwing exception. We did checked transportConnector on amazonMQ supports :
name
updateClusterClients
rebalanceClusterClients
updateClusterClientsOnRemove
Any idea how can we increase size of maximum connections?
As listed here that limit can be changed per AWS account.
You will need to open up an AWS support ticket requesting a limit increase
I guess I have to ask, Why so many connections?
Large has 1000 connections with Micro allowing 100 connections. Seeing in your error message you have 100 connections, are you on Micro? Maybe a Micro instance can't handle the load?
Are the producers/consumers something you control or is this a third party app? I would review code before increasing these levels if that is something you can do. Connections are to be shared as much as they can be. Are they being closed correctly when done? Are all your producers opening and maintaining their own connections?
Producer Connections should be grouped and shared with the PooledConnectionFactory.

Request time out 500 in asp.net4.5

When CPU Utilisation riches 70% to 80 % at that time when user call web service method for e.g like time 12.01.00 but it riches to database server after one minute like 12.02.00 and database server gives response in fraction of milliseconds for that request and we receive this error System.Web.HttpException (0x80004005): Request timed out in elmah .There is a time difference between receiving request at web service method and sending it to database. When CPU normal then everything works smoothly within fraction of seconds.I don't understand why this one min time difference occurring between received request at .net side and sending it to database. After reset iis every thing work normal .This happens only production server but not in development and UAT Server.
IIS version:-8.5 and sql 2012
In web.config update httpRuntime executionTimeout value:
<configuration>
<system.web>
<httpRuntime executionTimeout="300" />
</system.web>
</configuration>
executionTimeout: Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.The default is 110 seconds.

AWS Elastic Beanstalk: Looooooooong HEAD requests

I've just deployed a simple Java/Tomcat based application into Elastic Beanstalk (using the java8/tomcat8 config). Mostly the application works fine.
However, all HEAD requests seem to take 60 seconds. Feels like a timeout of some kind. I can't seem to find any settings regarding filtering or delaying particular types of requests. These requests work fine when I run locally. GET requests to the same URL work fine.
I've confirmed that both the Tomcat and the Apache instance on the server log the HEAD request instantly (which indicates they are done with it, right?).
I've confirmed (using telnet) that the client is not receiving any response header bytes until very late. This isn't a problem of the client waiting for a payload or something like that.
Furthermore, the delay is clearly tied to the load balancer's "Idle Timeout" setting. If I push that down to 5 seconds, then the HEAD requests take about 5 seconds, if I set the idle-timeout to 20 seconds then the HEAD requests take just about 20 seconds (always a few ms over). The default is 60s.
What could be causing all HEAD requests (even those returning a 401 unauthorized error, no processing) to clog up the works like that?
Turns out the problem was a firewall issue at the local site. AWS ElasticBeanstock was returning the responses in a timely manner, but they were getting clogged up in a local firewall. Grr..

Any known issues with ActiveMQ running on SGI

I'm having lots of issues trying to use ActiveMQ, and was wondering if there are any know issues running on SGI hardware - specifically a UV2k? Are there any known issues running on Suse linux?
Getting a lot of threads started when starting the ActiveMQ service, and getting an error message stating "Insufficient threads configured for selectChannelConnector". Tried limiting the JVM thread stack size with no joy.
ActiveMQ 5.10 snapshot
I haven't heard of UV2k, but it sounds like something with a lot of processors/cores, right?
Jetty, which is powering the webgui for ActiveMQ, uses one connection acceptor per four cores (roughly).
The default thread pool size is maxed at 256 threads in Jetty, so if you have above 1024 cores the thread pool won't be enough for jetty. A quick google shows the UV2K has "up to 4096 cores" (whatever that means, if this is the number Jetty consider - it means 1024 acceptors).
You can alter the Jetty thread pool by placing this element into the "server" bean in conf/jetty.xml. I leave the correct max size up to you to figure out.
<property name="threadPool">
<bean id="ThreadPool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<property name="minThreads" value="10"/>
<property name="maxThreads" value="XXX"/>
</bean>
</property>
Another thing you can try is to manually set the number of acceptors to a lower value, like 1 (you won't need much for an administrative UI). Look into your Connector bean (same file), and add the property <property name="acceptors" value="2"/>.
For obvious reasons, I have not tested the above config on the machine you mention, so consider it a "good guess" rather than a confirmed fact.