16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

234 Part III: Planning <strong>and</strong> Deployment<br />

the operations per second determined in planning the portal site. If it is not, your<br />

portal site will not be able to h<strong>and</strong>le the load you planned for.<br />

It is also important to note the average time to last byte. This is the amount of<br />

time a user would have to wait for a requested page. The number is in milliseconds,<br />

so a number greater than 1000 indicates that under the simulated load conditions an<br />

end user would have to wait more than 1 second for the requested page. This number<br />

is especially important to pay attention to if your users will not tolerate wait<br />

times.<br />

While the scripts just shown actually already do generate good stress on the<br />

servers, there is one thing that was not taken into consideration so far: the caching<br />

of site components such as style sheets, .gif, .jpg, <strong>and</strong> so on. If you are testing for<br />

environments over slow links, this is very important. The following script opens the<br />

default Home page, default.aspx, <strong>and</strong> checks the modified date of the site’s cascading<br />

style sheets (CSS) file against the local file if one exists. If the file had not been<br />

downloaded, the script will not download another copy. The code is as follows:<br />

RANDOMIZE<br />

Test.SetGlobalVariable “g_SERVER", “http://“<br />

servername = ““<br />

SERVER = Test.GetGlobalVariable(“g_SERVER”)<br />

Call GetHomepage<br />

Function GetHomepage<br />

GetUrl SERVER & “/default.aspx", “Homepage"<br />

’in this script we have added only one file. You can add more of<br />

‘these files if you want. (path of these ’ ’<br />

’ can be found out by looking at the page’s source)<br />

GetLastModifiedUrl “/styles/sps.css"<br />

End Function<br />

Sub GetUrl(strURL, strPage)<br />

RANDOMIZE<br />

‘usernumber can be changed to your preference<br />

F = INT(200 * RND)<br />

Test.GetCurrentUser<br />

tStart = Timer()<br />

Set oResponse = Test.SendRequest(strURL)<br />

tFinish = Timer()<br />

Test.GetNextUser<br />

End Sub<br />

Sub GetLastModifiedUrl(strURL)<br />

‘Open a new connection to the Web server<br />

dim oConnection<br />

Set oConnection = Test.CreateConnection(SERVERNAME, 80, False)<br />

If (oConnection Is Nothing) Then<br />

Test.Trace(“Error: Unable to create connection."&Servername)<br />

Else<br />

’Create a new Request<br />

Set oRequest = Test.CreateRequest<br />

Set oUser = Test.GetCurrentUser

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!