﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Kevin Dalton's Blog</title>
    <description>&lt;table&gt;
        &lt;tr&gt;
            &lt;td valign="top"&gt;&lt;img height="183" width="139" alt="" src="/Portals/0/Blog/blog-kevin-dalton.png" /&gt;&lt;/td&gt;
            &lt;td valign="top"&gt;
            &lt;p&gt;Kevin Dalton is the Manager of Software Development for Quest's Benchmark Factory for Databases . One of the original architects of the product, Kevin has been working on its development for more than 10 years. He has experience with several database technologies, including Oracle, SQL Server, Sybase, MySQL, and IBM UDB. Kevin holds a bachelor's degree in electrical engineering and has been involved in software development since 1989. &lt;/p&gt;
            &lt;p&gt;Kevin's blog will focus on Benchmark Factory for Databases.&lt;/p&gt;
            &lt;p&gt;&lt;font color="#003366" size="3"&gt;&lt;strong&gt;Recent postings:&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
&lt;/table&gt;</description>
    <link>http://www.toadworld.com/BLOGS/tabid/67/BlogId/30/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>Kevin Dalton</managingEditor>
    <webMaster>webmaster@toadworld.com</webMaster>
    <pubDate>Mon, 15 Mar 2010 13:39:55 GMT</pubDate>
    <lastBuildDate>Mon, 15 Mar 2010 13:39:55 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.2.0.15477</generator>
    <item>
      <title>BFScripts, Part 3</title>
      <description>&lt;div&gt;
&lt;p&gt;In the final part of this series on BFScripts, we will look at the different ways you can use BFScripts to your benefit, including when performing user load tests and when connecting to a database.&lt;/p&gt;
&lt;p&gt;The most common use of BFScripts is to randomize SQL statements when simulating large numbers of users. As I mentioned in the first part of this blog series, , you will yield unrealistic results by submitting the same SQL from each virtual user. Doing so will cause the database server to cache the SQL results, thus increasing performance, and the real world is never that predictable. &lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="598" height="154" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Kevin Dalton/KDblog_030910-1.gif" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;A better way to perform this test involves randomizing the SQL transactions using BFScripts for a bind parameter value, as seen above. Using the same SQL statement above, you can convert the BFScript to a bind parameter value, as seen below.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Kevin Dalton/KDblog_030910-2.gif" /&gt;&lt;/p&gt;
&lt;p&gt;Another little known, but useful, way to use BFScripts is in the connection profile to change database logon credentials. For example,  you can use BFScripts to find Oracle profile user names and passwords, as seen in the screenshot below.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Kevin Dalton/KDblog_030910-3.gif" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;You can find more details on how to do this at the &lt;a href="http://benchmarkfactory.inside.quest.com/thread.jspa?threadID=5916&amp;tstart=15"&gt;Benchmark Factory community&lt;/a&gt;:&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;BFScripts can also be used in the command line for an external file you want to execute before or after an iteration. Using BF Scripts here allow you to gather information such as current userload, to external scripts. This will help you as you gather more information about performance, create data files, and so on. As you can see below, we are calling a batch file to create a data file that will be used to read real data inside executed SQL statements.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Kevin Dalton/KDblog_030910-4.gif" /&gt;&lt;/p&gt;
&lt;p&gt;Yet another way to BF Scripts is when customizing your Benchmark Factory job by adding Execute File steps.  These steps can be used to restore a database before a test run and when changing the database configuration. There is a &lt;a href="http://benchmarkfactory.inside.quest.com/shares/benchmarkfactory/sbin/Videos/BFScripts/ExecuteFileWithBFScripts.htm"&gt;video located on the BMF community&lt;/a&gt; showing how to add BFScripts to customize a BMF job.&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;Do you use BFScripts to control connecting to the database server or for executing external commands?   Is there anywhere else you would like to see BFScripts available? I’d love to hear your comments!&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;</description>
      <link>http://www.toadworld.com/BLOGS/tabid/67/EntryID/512/Default.aspx</link>
      <author>Kevin Dalton</author>
      <comments>http://www.toadworld.com/BLOGS/tabid/67/EntryID/512/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.toadworld.com/Default.aspx?tabid=67&amp;EntryID=512</guid>
      <pubDate>Tue, 09 Mar 2010 15:59:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.toadworld.com/DesktopModules/Blog/Trackback.aspx?id=512</trackback:ping>
    </item>
    <item>
      <title>BFScripts, Part 2</title>
      <description>In this blog, part 2 of a three part series, I will show you some ways BMF helps you in creating your BFScripts.
</description>
      <link>http://www.toadworld.com/BLOGS/tabid/67/EntryID/509/Default.aspx</link>
      <author>Kevin Dalton</author>
      <comments>http://www.toadworld.com/BLOGS/tabid/67/EntryID/509/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.toadworld.com/Default.aspx?tabid=67&amp;EntryID=509</guid>
      <pubDate>Tue, 23 Feb 2010 14:28:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.toadworld.com/DesktopModules/Blog/Trackback.aspx?id=509</trackback:ping>
    </item>
    <item>
      <title>BFScripts, Part 1</title>
      <description>&lt;p&gt;One question that has been coming up lately is how I can randomize my SQL so that not every user is submitting the same statements.  This is very important in creating a realistic workload to correctly perform a database performance test.  Without this step the database will either pull data from cache or there will be a larger than normal amount of constraints/conflicts, such as updating the same row in a table.&lt;/p&gt;
&lt;p&gt;Fortunately, Benchmark Factory has a very handy scripting language called BFScripts. Although it is more of a macro language than a scripting one, it does provide several easy to use scripts to randomize data such as numbers, characters, dates, etc. &lt;/p&gt;
&lt;p&gt;So, in this first of a three-part blog, I will give you an introduction to BFScripting and its common uses.&lt;/p&gt;
&lt;p&gt;Let’s say that you have a simple SQL statement as shown below;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;SELECT CustomerID, FirstName, LastName &lt;br /&gt;
  FROM Customers &lt;br /&gt;
  WHERE LastName like ‘SM%’&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As you can see, we are searching for customers whose last name starts with the letters SM.  When I run this SQL with thousdands of users, it would not be realistic since all users would not be looking for the same characters. This is where BFScripts can be used.  All BFScripts start with $BF and can perform a large number of randomization functions such as numbers, characters, dates, etc.  In this case we want to randomly select two characters, so we can use the $BFRandStr function like:&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;SELECT CustomerID, FirstName, LastName&lt;br /&gt;
  FROM Customers &lt;br /&gt;
  WHERE LastName like ‘$BFRandStr(2,ALPHA_UPPER)%’&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And when this is executed the entire $BFRandStr function will be replaced with two random uppercase alphanumeric characters like:&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;SELECT CustomerID, FirstName, LastName &lt;br /&gt;
  FROM Customers &lt;br /&gt;
  WHERE LastName like ‘BP%’&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now the above is just a simple example. You can also use BFScripts within BFScripts to create the output you need.  So let’s say we have a similar select but you would like to use your own data, such as:&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;SELECT CustomerID &lt;br /&gt;
  FROM Customers &lt;br /&gt;
  WHERE LastName = ‘x’ &lt;br /&gt;
    AND FirstName = ‘y’&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can create a text file with your own data:&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;"Jones","Kevin"&lt;br /&gt;
"Smith","Steve"&lt;br /&gt;
"Cool","Joe"&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And for this example we will call it mydata.txt.  Also, we would like virtual user one to use the first row of data, virtual user 2 to use the second row and so on.  You can use a combination of the $BFFileArray and $BFCurrentUser to accomplish this:&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;SELECT CustomerID &lt;br /&gt;
  FROM Customers &lt;br /&gt;
  WHERE LastName = ‘$BFFileArray(“c:\mydata.txt”, SELECTION, 1, $BFUserIID())’ &lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;    AND FirstName = ‘$BFFileArray(“c:\mydata.txt”, SELECTION, 2, $BFUserIID())’&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When the $BFFileArray script is being evaluated, the BMF script engine sees the $BFUserID() and evaluates it to be the virtual user number. This number is then used by the $BFFileArray to select the row number, so virtual user 1 will use row 1, virtual user 2 will use row 2 and so on.&lt;/p&gt;
&lt;p&gt;There are several BFScripts that are available to use, so please refer to the BMF help file for more information and examples on how to use the scripts.&lt;/p&gt;
&lt;p&gt;What level of experience do you have with BFScripts?  Do you have a favorite BFScript function?  Is there a function you would like to see?  I’d love to hear your comments!&lt;/p&gt;</description>
      <link>http://www.toadworld.com/BLOGS/tabid/67/EntryID/368/Default.aspx</link>
      <author>Kevin Dalton</author>
      <comments>http://www.toadworld.com/BLOGS/tabid/67/EntryID/368/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.toadworld.com/Default.aspx?tabid=67&amp;EntryID=368</guid>
      <pubDate>Fri, 01 May 2009 18:22:00 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.toadworld.com/DesktopModules/Blog/Trackback.aspx?id=368</trackback:ping>
    </item>
    <item>
      <title>Benchmarking and Latency</title>
      <description>&lt;div&gt;
&lt;p&gt;Welcome to my first blog! I am very excited about this opportunity to relay information about benchmarking/performance testing and, in particular, Benchmark Factory for Databases (BMF), but where to begin? For my first blog, I’ll start on the topic of latency.&lt;/p&gt;
&lt;p&gt;One key thing to understand when doing testing is the characteristics of the workload, and a big piece of the workload is how fast the transactions are submitted to the system under test - or what is commonly called latency.   The two most common latency types are ‘Keying’ and ‘Think’ time. &lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;Keying is a delay before the SQL is sent to the database server and is used to simulate a real user keying in a request before submitting it. A good example of this is doing a user typing in a search for customers who live in a particular state.   Think time is the delay applied after a SQL request has been processed and results returned to simulate the user thinking about what to do next.   Figure 1 shows this relationship between keying and think time with the SQL execution.&lt;/div&gt;
&lt;div align="center"&gt;
&lt;p&gt;&lt;strong&gt;&lt;img height="143" alt="" width="577" src="http://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Kevin Dalton/KDblog_031209-1.gif" /&gt;&lt;br /&gt;
Figure 1 – Keying and Think time relationship&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;There is another latency type called ‘Interarrival’ time and it is a dynamic think time used to set the rate that requests are sent to the server.   So if you want to make sure that requests are sent to the server at a rate of 1 per every 60 seconds, you would set the interarrival rate to 60 seconds. The dynamic delay is then calculated to see how much time is left, after the time for the SQL request, to guarantee that 1 minute would elapse before the next SQL is requested. Using our example of an interarrival rate of 60 seconds from above, if the request takes 23 seconds then calculated wait time would be 60 seconds – 23 seconds = 37 seconds, as seen in Figure 2 below.&lt;/div&gt;
&lt;div align="center"&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Kevin Dalton/KDblog_031209-2.gif" /&gt;&lt;br /&gt;
Figure 2 – Interarrival Time&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;So if the next SQL execution would take only 4 seconds to execute, then the interarrival delay would be 56 seconds.&lt;/p&gt;
&lt;p&gt;Why would you use the different latency models? Keying and Think time are best used if you want to have a workload that simulates real world users vs. submitting the SQL as fast as possible. Modeling your workload to simulate real world users allows for easier result interpretation. So if your results say that your server maximum throughput is at 1000 users, you know that 1000 real users are the most your server can handle. If you decide not to use real world modeling, then you need to figure out how many real users your “fast” users equate to.&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;Interarrival time is commonly used if you want to guarantee the timing relationship between the executing SQL. The majority of the time this is used in a playback/replay workload where the user wants to playback the captured workload with the same timing relationships.&lt;/p&gt;
&lt;p&gt;What are your experiences with workload testing and latency? Which types of latency do you most often test for? I’d love to hear your comments!&lt;/p&gt;
&lt;/div&gt;</description>
      <link>http://www.toadworld.com/BLOGS/tabid/67/EntryID/348/Default.aspx</link>
      <author>Kevin Dalton</author>
      <comments>http://www.toadworld.com/BLOGS/tabid/67/EntryID/348/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.toadworld.com/Default.aspx?tabid=67&amp;EntryID=348</guid>
      <pubDate>Thu, 12 Mar 2009 16:41:00 GMT</pubDate>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.toadworld.com/DesktopModules/Blog/Trackback.aspx?id=348</trackback:ping>
    </item>
  </channel>
</rss>