Connections

To enhance the security of your connections and to optimize system resources, SuiteAnalytics Connect applies some restrictions to multiple sessions and the connection may time out after some time of inactivity. When you are working with SuiteAnalytics Connect, consider the following:

Multiple Concurrent Sessions

You should close unused connections and maintain a minimum number of open connections. Using many connections at the same time can slow performance and the retrieval of results.

If a connection fails with a Connect Timeout Error or the Connection Reset By Peer Error, you should retry to obtain a new connection.

Important:

SuiteAnalytics Connect allows multiple concurrent sessions. However, if you try to access the Connect Service using many connections at the same time, you may be unable to connect. Depending on factors such as hardware and system resources, the maximum number of open connections allowed varies. If you are working with more than 50 open connections, you may get an error and be unable to access the Connect Service. If this happens, you should close all unused connections and try again.

Multiple Concurrent Queries

Running multiple queries in a single session is not allowed. If you need to run multiple queries, do one of the following:

  • If you use a single session, run one query at a time. After you receive the results of the first query, then you can run the second one.

  • Use multiple sessions to run your queries in parallel. Note that using many connections at the same time can slow performance and the retrieval of results. For more information, see Multiple Concurrent Sessions.

Idle Session Timeout

Sessions automatically time out after 90 minutes of inactivity. If you exceed the time limit of inactivity, you are logged out of your session. To access the Connect Service, you must log in again.

Note:

The time during which a query is running is not considered time of inactivity. For more information about the connection and response time when you run a query, see Idle Connection Timeout.

The idle session timeout applies to ODBC, JDBC, and ADO.NET drivers, and occurs when you query the NetSuite data sources: NetSuite.com and NetSuite2.com.

Idle Connection Timeout

By default, if a query exceeds the response time limit, you will not receive any results and the query will keep running. For information about the potential causes, see Troubleshooting the "TCP/IP error, connection reset by peer" Message.

Note:

The KeepAliveTime parameter is supported for ODBC and JDBC drivers only.

This parameter is used by some operating systems to verify periodically that the idle TCP connections are still active. By default, this parameter is set to 7,200,000 ms (2 hours) and affects all system applications. You can change the settings and enter a lower value. For example, if you set the value to three minutes, the idle TCP connections are verified every three minutes. After this change, if you run a query and you do not receive any results within the next three minutes, the connection is not interrupted. Every three minutes the driver sends a keep-alive packet to keep the connection active.

Setting the KeepAliveTime Parameter on Windows

For Windows, you must set the time value in the KeepAliveTime file.

Note:

If you are using a JDBC driver, you must also add the TCPKeepAlive parameter to your connection string and set the parameter to true. For more information, see JDBC Connection Properties.

To set the KeepAliveTime Parameter on Windows:

  1. Open the Registry Editor application.

  2. For most Window versions, go to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > Tcpip > Parameters.

  3. To create the KeepAliveTime file, right-click the Parameters folder, and select New > DWORD 32-bit Value.

    Note:

    If the folder includes the KeepAliveTime file, right-click the file to modify the value.

  4. In the Name column, enter KeepAliveTime.

  5. Right-click the KeepAliveTime file and select Modify. In the Value data field, enter the time value in milliseconds.

    In the following example, the value has been changed to 180000 ms (3 minutes). Use your best judgement to decide the time value that you want to use in your settings.

    KeepAliveTime example

After you set this parameter, restart your machine for the changes to take effect.

Setting the KeepAliveTime Parameter on Linux

For Linux, you must enter a value for the following variables:

  • net.ipv4.tcp_keepalive_time – Time of connection inactivity after which the first keep-alive request is sent.

  • net.ipv4.tcp_keepalive_probes – Number of keep-alive requests sent before the connection is considered not active.

  • net.ipv4.tcp_keepalive_intvl – Time interval between keep-alive probes within a request.

The following example shows how you can configure the KeepAliveTime parameter to send 3 probes every 60 seconds with an interval of 10 seconds.

sudo sysctl -w net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_probes=3 net.ipv4.tcp_keepalive_intvl=10

After you configured the parameter, you must restart the network interfaces for the changes to take effect. To do so, run the following command:

/etc/init.d/network restart

To ensure that the changes are kept, you must store the changes to the corresponding system configuration file. Otherwise, these changes do not persist after you restart your computer.

Note:

If you are using a JDBC driver, you must also add the TCPKeepAlive parameter to your connection string and set the parameter to true. For more information, see JDBC Connection Properties.

Troubleshooting the "TCP/IP error, connection reset by peer" Message

You may get the following message which indicates that the connection was closed: TCP/IP error, connection reset by peer.

There are several reasons that can trigger this message. See the following:

  • If the error message appears only once or at a specific time of the day, it is most probably caused by the server restart or a network issue.

  • If you constantly get this error when you run queries that take long, there is something that is terminating your connections. The idle connection timeout is set to 7,200,000 ms (2 hours) on NetSuite's side. If you get the TCP/IP error after 2 hours of running a query, you should adjust the KeepAliveTime parameter to a value lower than 2 hours.

    A firewall on your system or your network can be configured to terminate connections that are considered idle. Determine the value that is configured as idle time and set your KeepAliveTime parameter to a lower value to prevent the firewall from closing the connections.

Related Topics

General Notices