Guest

Cisco IOS Software Releases 12.1 T

Parser Cache

Downloads

Table Of Contents

Parser Cache

Feature Overview

Restrictions

Related Documents

Supported Platforms

Supported Standards, MIBs, and RFCs

Configuration Tasks

Clearing the Parser Cache

Disabling the Parser Cache

Enabling the Parser Cache

Troubleshooting Tips

Monitoring and Maintaining the Parser Cache

Configuration Examples

Command Reference

clear parser cache

parser cache

show parser statistics


Parser Cache


This feature guide describes the Parser Cache feature introduced in Cisco IOS release 12.1(5)T and 12.0(22)S, and includes the following sections:

Feature Overview

Supported Platforms

Supported Standards, MIBs, and RFCs

Configuration Tasks

Monitoring and Maintaining the Parser Cache

Configuration Examples

Command Reference

Feature Overview

The Parser Cache feature optimizes the parsing (translation and execution) of Cisco IOS software configuration command lines by remembering how to parse recently encountered command lines. This feature was developed to improve the scalability of the Cisco IOS software command-line interface (CLI) parser when processing large configuration files.

The Parser Cache feature can rapidly recognize and translate configuration lines which differ slightly from previously used configuration lines (for example, pvc 0/100, pvc 0/101, and so on) by dynamically creating, caching, and reusing simplified parse graphs. This improvement is especially useful for configuration files which repeat similar commands hundreds or thousands of times, such as cases in which thousands of virtual circuits must be configured for subinterfaces, or hundreds of access lists must be configured.

Cisco testing indicates an improvement to load time of up to 36% for large configuration files when using the Parser Cache feature. Performance will increase the most for those files in which the same commands are used repeatedly but the numerical arguments change from command to command.

The parser cache is enabled by default on all platforms using Cisco IOS release 12.1(5)T or later or Cisco IOS release 12.0(22)S or later.

Restrictions

The Parser Cache feature is a performance enhancement for Cisco devices which typically have large configuration files. Users with other Cisco devices may wish to disable this feature to free the resources used by this feature. Memory used by this feature is dependant on the size of the configuration files which are parsed, but is generally less than 512K.

Related Documents

None.

Supported Platforms

The Parser Cache feature is available in all Cisco IOS software images based on Cisco IOS release 12.1(5)T. Supported platforms include:

Cisco 800 series

Cisco 1400 series

Cisco 1600 series

Cisco 1700 series

Cisco 2500 series

Cisco 2600 series

Cisco 3600 series (including the Cisco 3620, 3640, and 3660)

Cisco MC3810 Multiservice Concentrator

Cisco 4500

Cisco 5300 series

Cisco 5400 series

Cisco 5800 series

Cisco 7100 series

Cisco 7200 series

Cisco 7500 series (rpm and rsp images)

Cisco ICS7700

Catalyst 2900 Series XL (c29atm images)

Catalyst 4000 Series Access Gateway (c4gwy images)

Cisco uBR7200

Cisco uBR910

Cisco uBR920

This feature is also supported in the following Cisco IOS software images:

c25fx, regen, vg200

Supported platforms in Cisco IOS Release 12.0(22)S include:

Cisco 7200 Series

Cisco 7500 Series (rpm and rsp images)

Cisco 10000 Series

Cisco 10700 Series

Cisco 12000 Series

Supported Standards, MIBs, and RFCs

Standards

None.

MIBs

None.

RFCs

None.

Configuration Tasks

See the following sections for configuration tasks for the Parser Cache feature. Each task in the list is identified as either optional or required.

Clearing the Parser Cache (optional)

Disabling the Parser Cache (optional)

Enabling the Parser Cache (optional)

Clearing the Parser Cache

To free resources or to reset the parser cache memory, you may wish to clear the parse entries and hit/miss statistics stored by the Parser Cache feature. To delete the information stored by the Parser Cache feature, use the following command in privileged EXEC mode:

Command
Purpose

Router# clear parser cache

Clears the parse cache entries and hit/miss statistics stored for the Parser Cache feature.


Disabling the Parser Cache

The Parser Cache feature is enabled by default. To disable the Parser Cache feature, use the following command in global configuration mode:

Command
Purpose

Router(config)# no parser cache

Disables the Parser Cache feature.


When the parser cache is disabled, the no parser cache command line is written to the running configuration file.


Tips If you wish to disable the parser cache to free system resources, you should clear the parser cache before issuing the no parser cache command. You will not be able to clear the parser cache after disabling it.


Enabling the Parser Cache

To reenable the Parser Cache feature after disabling it, use the following command in global configuration mode:

Command
Purpose

Router(config)# parser cache

Enables the Parser Cache feature.


Troubleshooting Tips

If you are attempting to load a configuration file that worked in a previous release but is generating errors in Cisco IOS release 12.1(5)T, try clearing and disabling the parser cache and loading the file again.

Monitoring and Maintaining the Parser Cache

Statistics about the last configuration file parsed are now kept in the system memory, along with hit/miss statistics on the commands parsed by the Parser Cache feature. "Hits" and "misses" refer to the matches that the parser cache was able to make to similar commands used previously in the configuration session. Those commands that are matched ("hits") are able to be parsed more efficiently. The parser cache is unable to improve the parse time for those commands it was unable to match ("misses").

To view the parser statistics use the following command in privileged EXEC mode:

Command
Purpose

Router# show parser statistics

Displays statistics about the last configuration file parsed and the status of the Parser Cache feature.


The following example shows sample output from the show parser statistics command:

Router# show parser statistics
Last configuration file parsed:Number of Commands:1484, Time:1272 ms
Parser cache:disabled, 0 hits, 0 misses

The show parser statistics command displays two sets of data:

The number of commands in the configuration file that was last copied into the running configuration, and the time it took for the system to parse them (a configuration file can be loaded into the running configuration at system startup, or by issuing commands such as the copy source running-config command).

The status of the parser cache (enabled or disabled) and the number of command matches (hits or misses) since the system was started or since the parser cache was cleared.

In the example above the hit/miss statistics do not match the number of commands in the last configuration file parsed, which indicates that the last configuration file was loaded while the parser cache was disabled.

The show parser statistics command allows you to compare the parse-time of a configuration file with parser cache disabled and enabled, as shown in the following section.

Configuration Examples

This section provides an example of using the show parser statistics command to compare the parse-time of a large configuration file. In this example, a configuration file with 1,484 access list (ACL) commands is loaded into the running configuration.

Router# configure terminal
!parser cache is disabled
Router(config)# no parser cache
!configuration file is loaded into the running configuration
Router# copy slot0:acl_list running-config
. . .
Router# show parser statistics
Last configuration file parsed:Number of Commands:1484, Time:1272 ms
Parser cache:disabled, 0 hits, 2 misses
!the parser cache is reenabled
Router(config)# parser cache
!configuration file is loaded into the running configuration
Router# copy slot0:acl_list running-config
. . .
Router# show parser statistics
Last configuration file parsed:Number of Commands:1484, Time:820 ms
Parser cache:enabled, 1460 hits, 26 misses

These results show an improvement to the load time for the same configuration file from 1272 milliseconds to 820 milliseconds when the Parser Cache feature was enabled. As indicated in the "hits" field of the show command output, 1,460 commands were able to be parsed more efficiently by the parser cache.

Command Reference

This section documents the following new commands. All other commands used with this feature are documented in the Cisco IOS Release 12.1 command reference publications.

clear parser cache

parser cache

show parser statistics

clear parser cache

To clear the parse cache entries and hit/miss statistics stored for the Parser Cache feature use the clear parser cache command in privileged EXEC mode.

clear parser cache

Syntax Description

This command has no arguments or keywords.

Defaults

No default behavior or values.

Command Modes

Privileged EXEC

Command History

Release
Modification

12.1(5)T

This command was introduced.

12.0(22)S

Support for this command was integrated in Cisco IOS Release 12.0 S.


Usage Guidelines

The Parser Cache feature optimizes the parsing (translation and execution) of Cisco IOS software configuration command lines by remembering how to parse recently encountered command lines, decreasing the time it takes to process large configuration files.

The clear parser cache command will free the system memory used by the Parser Cache feature and will erase the hit/miss statistics stored for the output of the show parser statistics command. This command is only effective when the Parser Cache feature is enabled.

Examples

The following example shows the clearing of the parser cache:

Router# show parser statistics
Last configuration file parsed:Number of Commands:1484, Time:820 ms
Parser cache:enabled, 1460 hits, 26 misses
Router# clear parser cache
Router# show parser statistics
Last configuration file parsed:Number of Commands:1484, Time:820 ms
Parser cache:enabled, 0 hits, 1 misses


Related Commands

Command
Description

parser cache

Enables or disables the Parser Cache feature.

show parser statistics

Displays statistics about the last configuration file parsed and the status of the Parser Cache feature.


parser cache

To re-enable the Cisco IOS software parser cache, use the parser cache global configuration command. To disable the parser cache, use the no form of this command.

parser cache

no parser cache

Syntax Description

This command has no arguments or keywords.

Defaults

Parser cache is enabled by default.

Command Modes

Global configuration

Command History

Release
Modification

12.1(5)T

This command was introduced.

12.0(22)S

Support for this command was integrated in Cisco IOS Release 12.0 S.


Usage Guidelines

The Parser Cache feature optimizes the parsing (translation and execution) of Cisco IOS software configuration command lines by remembering how to parse recently encountered command lines, decreasing the time it takes to process large configuration files.

The parser cache is enabled by default. However, if you wish to disable the parser cache, you may do so using the no parser cache command in global configuration mode. To re-enable the parser cache after it has been disabled, use the parser cache command.

When the no parser cache is issued, the command line appears in the running configuration file. However, if the parser cache is re-enabled, no command line appears in the running configuration file.

Examples

In the following example, the Cisco IOS software Parser Cache feature is disabled:

Router(config)# no parser cache

Related Commands

Command
Description

clear parser cache

Clears the parse cache entries and hit/miss statistics stored for the Parser Cache feature.

show parser statistics

Displays statistics about the last configuration file parsed and the status of the Parser Cache feature.


show parser statistics

To displays statistics about the last configuration file parsed and the status of the Parser Cache feature, use the show parser statistics command in privileged EXEC mode.

show parser statistics

Syntax Description

This command has no arguments or keywords.

Defaults

No default behavior or values.

Command Modes

Privileged EXEC

Command History

Release
Modification

12.1(5)T

This command was introduced.

12.0(22)S

Support for this command was integrated in Cisco IOS Release 12.0 S.


Usage Guidelines

The show parser statistics command displays two sets of data:

The number of commands in the configuration file that was last copied into the running configuration, and the time it took for the system to parse them (a configuration file can be loaded into the running configuration at system startup, or by issuing commands such as the copy source running-config command).

The status of the Parser Cache feature (enabled or disabled) and the number of command matches (indicated by hits/misses) since the system was started or since the parser cache was cleared.

The Parser Cache feature optimizes the parsing (translation and execution) of Cisco IOS software configuration command lines by remembering how to parse recently encountered command lines, decreasing the time it takes to process large configuration files.

Examples

The following example shows sample output from the show parser statistics command:

Router# show parser statistics
Last configuration file parsed:Number of Commands:1484, Time:1272 ms
Parser cache:disabled, 0 hits, 2 misses

In this example, the Parser Cache feature is disabled, but shows the hit/miss statistics for the two commands issued while the parser cache was last enabled.

Table 1 describes the key output fields:

Table 1 show parser statistics Output Fields

Last configuration file parsed:

Shows statistics on the last configuration file copied into the running configuration (at startup or using the copy command).

Number of commands:

The number of command lines in the last configuration file parsed.

Time:

Time, in milliseconds, it took for the system to load the last configuration file.

Parser cache:

Shows whether the Parser Cache feature is enabled or disabled, and the hit/miss statistics related to the feature. Statistics are stored since the initialization of the system, or since the last time the parser cache was cleared.

hits

Number of commands the parser cache was able to parse more efficiently by matching them to similar commands executed previously.

misses

Number of commands the parser cache was unable to match to previously executed commands. The performance enhancement provided by the Parser Cache feature can not be applied to unmatched commands.


Related Commands

Command
Description

clear parser cache

Clears the parse cache entries and hit/miss statistics stored for the Parser Cache feature.

parser cache

Enables or disables the Parser Cache feature.