Scalability of the add-member cmdlet.
- From: "Dung K Hoang" <dunghoangkhac@xxxxxxxxxxx>
- Date: Mon, 27 Feb 2006 16:55:20 -0800
I observe some strange behavior with the add-member cmdlet and would like to
get your ideas on this issue.
Basically, I have a script that creates MSH objects and add new propeties to
the objects using the add-member cmdlet.
Here is the script:
--------PerfAM.msh-----------------
param($Max_Object=(read-host "Number of objects"),
$MaxAttributes= (read-host "Number of attributes") )
for ( $j =0 ; $j -lt $Max_Object; $j++)
{
$script:LogObj = new-object System.Management.Automation.MshObject
for ($i = 0; $i -lt $MaxAttributes ; $i++)
{
add-member -in $script:LogObj -Type NoteProperty -Name
"Attribute$i" -Value $i -force > $Null
}
$script:LogObj
}
------------------------------------
Here are my observations when running the script on a Pentium M 2 GHz with 2
GB of RAM
Num of objects | Num of Attributes | Processing-time
---------------------------------------------------------
1K | 1 | 00:00:01
1K | 10 | 00:00:07
1K | 100 | 00:01:04
1K | 1000 | 00:10:55
1M | 1 | 00:19:11
During the execution of the script, the CPU is constantly at 100%
occupation.
I am not able to run the script with 1M objects and 10 attributes.
Monad throws a memeory exception even though my machine has 1 GB of
available memory!
Has anyone seen this behavior?
Thanks for any advice on how to optimize the script,
/Dung
.
- Follow-Ups:
- Re: Scalability of the add-member cmdlet.
- From: Nick Howell
- Re: Scalability of the add-member cmdlet.
- Prev by Date: Re: help with scripting AD attribute change
- Next by Date: Re: [MSH] Send email
- Previous by thread: Re: SNMP Script
- Next by thread: Re: Scalability of the add-member cmdlet.
- Index(es):
Relevant Pages
|