Issue

The Code Tracing monitor displays so many pages of Code Traces that it is difficult to delete them all in the GUI.  The customer would like to just remove them all and start over.

Environment

Zend Server for IBM i, running on any supported version of IBM i.  

ZENDPHP74 for versions 2020.x and higher

ZENDPHP7 for versions 9.1.x and higher (including 2018.0.x and 2019.0.x)

ZENDSVR6 for version 6 - 8.5.x

Resolution

If Code Tracing is enabled for one or more very common events, then code trace dumps can accumulate very quickly, and reach unmanageable levels.  Code Tracing is meant to be a diagnostic tool, and in general should not be routinely enabled for events in a production environment.  Instead, Code Tracing should be enabled for an event type that is under active investigation, and should be disabled when the investigation is concluded.  The following steps can help you clear the code trace dumps and data base if too many accumulate for manual deletion.

Note: This procedure requires a restart of Zend Server, so your web site will be down for a few minutes.  Please schedule this activity for a time when the service disruption will have the minimum impact.

1.  (Optional) Consider disabling Code Tracing for Monitor Events, to prevent proliferation of excess Code Trace dumps.  This setting can be used later to turn Code Tracing On and Off only as needed to research issues.   In the Zend Server Administrative interface, go to the Configurations -> Monitor tab.  Under the heading "Code Tracing Settings", select the "Disable Code Tracing" button.  Click the "Save" button to save the change.  Do not restart the PHP server at this time, it will be done in a later step.


2.  Using Navigator, the RSE view in Zend Studio, a mapped network drive, a graphical FTP client like FileZilla, or any other utility you may have, navigate to this folder in the IFS:

Note:  If you are on Zend Server versions 9.1 - 2019.x please replace all instances of ZENDPHP74 with ZENDPHP7, Zend Server versions 6 - 8.5.x, please replace all instances of ZENDPHP74 with ZENDSRV6

/usr/local/zendphp74/var/codetracing

Delete all of the files in the directory.  You can use the wrklnk command to do this task, but there may be thousands of files to page through, so a tool with a graphical interface is probably much easier.  It can take a lot of time to delete many thousands of files from the IFS, so you can do most of this ahead of time during the day, then finish up any late additions just prior to the restart of Zend Server.

3.  Next, navigate to this folder (it should be right next to the previous folder):

/usr/local/zendphp74/var/db

Delete file       codetracing.db.

Delete file      monitor_codetracing      if exists

4.  Stop and Restart Zend Server.  From the 5250 command line:

go zendphp74/zsvmenu

Use option "2. Stop Zend Server Subsystem".  Then, on the command line below the menu:

wrkactjob sbs(zendphp74)

Verify there are no active jobs in the subsystem. If any jobs remain, use F5 a few times until they are all gone.  If any jobs persist for more than a few minutes, end them manually.  Then, F3 back to the command line and:

wrkactjob sbs(qhttpsvr)

Verify there are no jobs named ZENDPHP74 in this subsystem.  There can be other jobs and those other jobs should be left alone.  As before, use F5 until all the ZENDPHP74 jobs are gone, and feel free to end them manually if it seems you are waiting to long.  Then use F3 to return, which should bring you back to the menu.

Use option "1. Start Zend Server Subsystem".  This will start up Zend Server.  Give it a couple of minutes for all of the Apache jobs to start, then return to the Zend Server Admin in your browser and verify that there are no Code Traces showing on the Overview -> Code Tracing tab.