IBM Support

High CPU usage in application using TCPIP sockets

Troubleshooting


Problem

An application that uses TCPIP services to communicate with other servers or clients shows a high level of CPU usage.

Symptom

Examination of a SYSTRACE shows that it is in an endless loop with a repeating pattern of PC calls. For CICS transactions, the transaction will have repeated calls to EZACIC01 with corresponding PC activity in one of the EZACIC03 subtasks.

Cause

The application is not properly responding to a returned value of zero (0) from a read() or recv() call for an established TCP socket. A zero length is the only indication that the remote side of the connection is not going to send any more data (it has issued a close() or shutdown() call); there is no error returned for this case. If the application does not drop out of its read loop at this point but instead continues to issue the read() or recv() call, it will continue to get the zero length value returned.


A NETSTAT command shows that the connection is in the CloseWait state. A NETSTAT ALL command shows output similar to the following for the related session:


NOTE: The time will be reported according to the setting of the TZ environment variable, default is UCT (GMT). See Technote #1140187 for more information.

Resolving The Problem

Contact the developer or vendor to have the application corrected.

As a recovery process, when this condition is detected perform the following actions:

  • Use the NETSTAT command to display the data shown above.

  • From TSO: NETSTAT ALL (CLIENT jobname
    From the UNIX shell: netstat -A -E jobname
    From the operator console: DISPLAY TCPIP,,NETSTAT,ALL,CLIENT=jobname
      NOTE: The ALL option is not available from the operator console before z/OS 1.10.
  • Note the Client ID of the session(s) that matches the conditions shown in the above output.
  • Use the DROP function to terminate the session. This sends an error indication back to the application. Assuming that it properly handles an error return from the RECV call, the loop terminates.

    From the operator console, VARY TCPIP,,DROP,clientid
    From TSO, NETSTAT DROP clientid
    From the UNIX shell, netstat -D clientid

    • NOTE: Dropping sessions via the NETSTAT command requires that the user to be authorized to the MVS.VARY.TCPIP.DROP profile in the OPERCMDS class.

[{"Product":{"code":"SSSN3L","label":"z\/OS Communications Server"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"All","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"1.6;1.7;1.8;1.9;1.10;1.11;1.12;1.13;2.1;2.2;2.3","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
15 June 2018

UID

swg21215958