Page 1 of 3 123>
Topic Options
#117922 - 2004-04-15 12:48 AM execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
I have a fairly short script that takes a long time(approximately 2.5 minutes) to execute. I will be useing this as a logon script so I am obviously concerned about the execution time.
In the script I have 1 IF InGroup and approximately 5 If Exists. This script will grow to a MUCH LARGER size before I am finished.

I am wondering if this is an average execution time for this size script. Is it possible that most of my time is taken up with the group chacheing?

I did notice that if I 'short circuited' the If InGroup statement it took 1.5 minutes off my execution time. If InGroup is one of the culprits would I get better execution time using my own array for getting the groups?

Also, Any tips on increaseing speed will help drasticly. Even if it is rearrangeing the script in certain ways to help the exe 'compile' it quicker.

PS. This script is very likely to have tons of InGroups in it.

Top
#117923 - 2004-04-15 12:55 AM Re: execution time
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
We can't really help you if you don't even show your script. However, 2 1/2 minutes is way to long.
_________________________
There are two types of vessels, submarines and targets.

Top
#117924 - 2004-04-15 12:56 AM Re: execution time
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
First off, KiX does a pre-fetch so the delay is not commensurate with the number of InGroup() functions. That said, you have a problem with your network setup. It should not take that long!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#117925 - 2004-04-15 12:58 AM Re: execution time
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
This is not what I would consider a normal time. We have a script that does about 200 If InGroups and it only takes seconds. What is the client u are testing with? Are you checking domain group or local group? It may speed it up if you put the domain name before the group name, especially if you have more than one domain.

If InGroup ("Domain\Group")
Do Stuff
Endif

If you can try to provide some more info about your environment and we will try to help. You may also want to post the contents of the script.

Top
#117926 - 2004-04-15 01:03 AM Re: execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
The full script is as follows. I tended to think that this was very slow for normal operations. Thanks for all the help. Some of this is commented out because it will be comeing soon in our configuration, but we are not quite read for them yet.

;*************************************************************
; NAME: Clinton Login Script
;
; DATE : 4/14/04
;
; COMMENT:
;
;*************************************************************

;*************************************************************
; root variable intailization
;*************************************************************
$rootserver = "\\clnhfp01\"
$KixHome = $rootserver+"\ScriptTools\WKix32.exe"
$BatHome = $rootserver+"\ClintonLogon\bat\"
$ScriptHome = $rootserver+"\ClintonLogon\script\"

;*************************************************************
;Auto Install based Logic
; This is used for to install Applications automatically upon
; reboot
;*************************************************************

;*************************************************************
;Process M & N Drive Mappings
;*************************************************************
If (InGroup("TKNTOR\CLN__Clinton Users"))
$NTData = $RootServer+"NTData"
$NTSoftware = $RootServer+"NTSoftware"
Use M: $NTData
Use N: $NTSoftware
? "Drives should be connected"
endif

;*************************************************************
;Process Old Tor-Cl03 Drive Mappings
;*************************************************************
;If (InGroup("TKNTOR\CLN_Clinton Users"))
; Use q $RootServer+"Vol1\"
; Use u $RootServer+"NWData\"
; Use V $RootServer+"Vol4\"
; Use W $RootServer+"Vol3\"
; Use X $RootServer+"Vol2\"
; Use Y $RootServer+"Vol1\"
; Use Z $RootServer+"Sys\"
;endif

;*************************************************************
;Process User Home Drive Mappings
;*************************************************************
$UserHome = $rootServer+@UserID+"$"
if Exist($UserHome)
Use H $UserHome
endif

;*************************************************************
;Run login Batch if it exists
;*************************************************************
$AllUsersBat = $BatHome+"AllUsers.BAT"
If exist($AllUsersBat)
call $AllUsersBat
endif

$userbat = $BatHome+$uid+".BAT"
If exist($userbat)
call $userbat
endif

;*************************************************************
;Run login script if it exists
;*************************************************************
$AllUsersScr = $ScriptHome+"AllUsers.SCR"
If exist($AllUsersScr)
$KixHome $AllUsersScr
endif

$userScr = $ScriptHome+$uid+".SCR"
If exist($userScr)
$KixHome $userScr
EndIf


Top
#117927 - 2004-04-15 01:16 AM Re: execution time
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Have you tried commenting out the portions that call other scripts? My first guess would be that this portion is really what is taking the longest. Try commenting everything below this section...

Code:
;*************************************************************
;Process M & N Drive Mappings
;*************************************************************
If InGroup("TKNTOR\CLN__Clinton Users")
$NTData = $RootServer+"NTData"
$NTSoftware = $RootServer+"NTSoftware"
Use M: $NTData
Use N: $NTSoftware
? "Drives should be connected"
endif



Also you dont need the double parenthesis in the ingroup lines. Im not sure if that would cause any slow downs but just incase.

Top
#117928 - 2004-04-15 01:21 AM Re: execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
I had to add the extra set of parenthesis earlier today to get it to work. I know that sounds strange, but that is what it required.

Also it took 1.5 mins to get to that serction of the script. That is why the ? line was there (to help me gauge time). The problem may be the prefetch.

Top
#117929 - 2004-04-15 01:24 AM Re: execution time
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Think I know what it is, your resultant path names are incorrect, which is probably hangin-up the UNC's, for example in your script:

$rootserver = "\\clnhfp01\"
$KixHome = $rootserver+"\ScriptTools\WKix32.exe"

results in the string:

\\clnhfp01\\ScriptTools\WKix32.exe

two sets of double-back-whacks, which i think might be bad.

Top
#117930 - 2004-04-15 01:28 AM Re: execution time
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What OS is the test client?
What OSs are the other clients?
What OS are the DCs?
What version @KiX?
What protocols are on the network?
What network clients on the clients?
Do you have KXRPC service running?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#117931 - 2004-04-15 01:42 AM Re: execution time
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
There is no reason why you should have double parenthesis to make ingroup work. I think you have some kind of network problems or something.

I would also agree with Shawn that the double \'s are bad...But if what you say about it taking 1.5 minutes to get to the "? "Drives should be connected"" line is true then this is occuring before the double \'s come into play.

Top
#117932 - 2004-04-15 01:55 AM Re: execution time
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

I think you have some kind of network problems.



Gee... where did I hear that before?

Also, verify your DNS, WINS, and node type. You might want to run a network sniff to see what is going wrong.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#117933 - 2004-04-15 05:00 AM Re: execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
Thanks for catching the double \s. This is a error I missed. Logically to me though at that point of the script they are just variables. They should not effect my speed in the early part of the script (unless the parser is prepareing it in a special part of memory or something like that.).

I agree that there should not have to be the double set of ( for the InGroup, but for some unknown reason it did not work until I placed the double set there. (This was suggested by one of our corporate contacts useing kixstart as well).

Top
#117934 - 2004-04-15 05:05 AM Re: execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
What OS is the test client?
Most are Windows NT 4.0 SP6 machines
What OSs are the other clients?
same
What OS are the DCs?
DCs are windows NT 4.0 (will be moveing to win2k later this year when we go AD.
What version @KiX?
latest downloadable version
What protocols are on the network?
Currently TCP/IP, Netbios, IPX (IPX will be going later this year)
What network clients on the clients?
MS Windows, Netware (Netware will be going later this year)
Do you have KXRPC service running?
No, I dont know about the finer point of what this would add to the mix yet.

Thanks

Top
#117935 - 2004-04-15 05:21 AM Re: execution time
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
You might want to read the FAQ Forum to learn about KXRPC.

Also, segemnt your code and test each segment, use DEBUG ON in appropriate locations to see why it is so slow. Basically, there's something seriosuly wrong with either your network or your script.
_________________________
There are two types of vessels, submarines and targets.

Top
#117936 - 2004-04-15 06:24 AM Re: execution time
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
FYI

Quote:

What version @KiX?
latest downloadable version




Does not specifically tell us what version you're running because were not sure where you downloaded from.

I will assume KiXtart 4.22

Just try running a whole new script on a test account.

In user manager place something like this on the account for testing.

KIX32.EXE TEST.KIX /F

Then in the script just place this code...

Code:
Break On

Dim $SO,$x
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')


DIM $RootServer,$NTSoftware
'Welcome to test script - going to sleep for 3 seconds ' ?
sleep 3
'Welcome to test script - going to sleep for 5 seconds ' ?
sleep 5
'Welcome to test script - going to sleep for 10 seconds ' ?
sleep 10
'Okay sleep timing should have been okay. Now we will try some other tasks.' ?
$RootServer = "\\clnhfp01\"
$NTSoftware = $RootServer + "NTSoftware"
'My NT Software location is: ' + $NTSoftware
'Will now attempt to map the N: drive to NTSoftware ' ?
Use N: $NTSoftware
'Mapping N drive error was: ' + @ERROR + ' - ' + @SERROR
get $x



This code should complete very quickly, if not then you will have to start digging into the way your Network is setup.

The get $x at the end of the code will cause the script to hold and wait until you press a key so that you can see all of this on screen.

Top
#117937 - 2004-04-15 01:55 PM Re: execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
Yup it is 4.22 . sorry about not knowing the version. I was home and checking the board by that time so my work resources were not available at that time. I was also time constrained due to 'kid' issues
I will try that as a test here shortly.

Top
#117938 - 2004-04-15 02:03 PM Re: execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
This script does not contain an InGroup. will kixstart still do the group pre-fetch? Or is the script system smart enough to know it wont need it so it wont pre-fetch it.
A little more information about our network structure:
TONS UPON TONS of groups(I would say 1k+, without counting)
BDC local to my plant
ISDN to PDC
Also, I am not testing this by actually logging in. I am executeing the command line that will be executed out of a .bat file.

Thanks

Top
#117939 - 2004-04-15 02:08 PM Re: execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
ok... forgot I had a tool that could count the groups. I have 1400 global groups and 10 local groups on the domain controller.
Top
#117940 - 2004-04-15 02:15 PM Re: execution time
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
If I were you, would test things like this:

Go into registry and delete this key:

HKEY_CURRENT_USER\Software\KiXtart\TokenCache

This is where Kixtart caches it's groups, it will cache all your group memberships only when/if you use the INGROUP() function, then I would run this script:

Code:

break on

$start = @TICKS

if ingroup("domain users")

?"In domain users"

endif

?"elapsed=" @TICKS-$start

exit 1



THen show us the output strings from this script ... then RUN THIS SCRIPT AGAIN and you should see a much improved reponse time.

btw, we have thousands of groups and over a hundred InGroups in our login script, the script takes just a few seconds to run.


-Shawn

Top
#117941 - 2004-04-15 02:38 PM Re: execution time
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
The output I recieved was as follows :

In Domain Users
elapsed=91872

Actual script time to run was 1 min 32 seconds

BTW, thanks for the location of the cache. With the way this program caches the grops it will come in handy for another program I will be writing later.

Top
Page 1 of 3 123>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.072 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org