cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FlexNet Code Insight Scan Speed Optimization

FlexNet Code Insight Scan Speed Optimization

Summary

This article discusses how to optimize scan speed with database optimization, match sliders, and other methods.

Synopsis

This articles discusses how to optimize scan speed with database optimization. match sliders, and other methods in FlexNet Code Insight..

Discussion

Database Optimizations

NOTE: Unless this is a new installation, always make a verified backup before attempting any work directly against the database.

MySQL:

After ensuring you have a verified backup available, shut down Palamida and run the following command against the MySQL schema defined in $palamida/config/core/core.db.properties, replacing $palamidaSchemaName with your Palamida schema name:

mysqlcheck -u root -p --optimize --databases $palamidaSchemaName

Oracle:

After ensuring you have a verified backup available, shut down Palamida, and rebuild all the indexes. You can generate the commands via a SQL query using concat, and replacing $palamidaSchema with your Palamida schema owner:

select 'alter index'||owner||'.'||index_name||' rebuild online nologging;' from dba_indexes where owner='$palamidaSchema';

Then, execute the output of this script to rebuild all the indexes on the Palamida owner's schema.

Scan Material Size

It is generally recommended that you break up Palamida projects into smaller workspaces. The optimum size for each workspace should be around 1GB.

Source Code Fingerprints

Source code fingerprint scanning is one of the deepest, and most time consuming methods of analysis in Palamida. To optimize scan performance, you can disable or limit the types of files whose content will be scanned for source code fingerprints by navigating to Detection tab in Workspace Settings:

User-added image

To disable scanning for specific source code languages, choose the language from the left (above) and un-check the Enable checkbox. You can disable any number of languages from source code fingerprint scanning.

Alternatively, if you wish to disable selectively specific types of files to be omitted from source code fingerprint analysis, choose the source code language type from the list on the left and add or remove the extensions on the right with the + and - buttons.

Removing Files with Generated Code

Files containing generated code will tend to be tagged for source code fingerprint matches due to similarities across generated code.

One way of reducing this effect is to scan a copy of your codebase that excludes files of generated code. Below is a shell script for producing this kind a copy of your codebase; it will copy all files - and preserve the directory structure of your codebase - except for those that contain the string 'auto-generated'. You can exclude files with other strings by replacing the value for "searchStr".

#!/bin/bash
# extracts files from sourceDir that do not contain the searchStr
# and copies them to the relative directory in targetDir.

sourceDir="/tmp/src"
targetDir="/tmp/tgt"
searchStr='auto-generated'
cd "$sourceDir"
grep -FLir "$searchStr" * | while read relSrcPath; do
    relDir=`dirname "$relSrcPath"`
    mkdir -p "${targetDir}/${relDir}" &&
    cp -v "$relSrcPath" "${targetDir}/${relDir}"
done

Drive

You can also decrease scan times by storing your workspaces and compliance library on SSD. It is also recommended to have your SSD on the same server as your scan server.

Using the Match Sliders

You can also improve the length of a scan by adjusting the 'Match' and 'Min Match' sliders in the Workspace Settings tab:

User-added image

Try adjusting the values for both 'Match' and 'Min Match' to 10 (it is set to 3 by default). This will find fewer Source Code Fingerprint Matches and will, consequently, decrease the length of the scan - especially when scanning common operating systems.

For more information on the meaning of 'Match' in Workspace Settings see What does the Match Slider in Workspace Settings do?.

Labels (1)
Was this article helpful? Yes No
No ratings
Comments

How long does it take to scan a 10GB code?
What is the accuracy of scanning?
Including the recognition rate of open source code, the accuracy rate of recognized open source code, the accuracy rate of license matching, etc.

Version history
Last update:
‎Oct 19, 2018 06:12 PM
Updated by: