Live Life. Life is Short. Life is an Adventure.

Words, photos and experiences of Ronald Bradford

Feb
10

MySQL Benchmarking

Link to this post

As of MySQL 5.1.4, there is a supported benchmarking tool called mysqlslap. Not sure where they got the name from, is there going to be a mysqltickle next?

create database mysqlslap
use mysqlslap
use schema.sql

mysqlslap –skip-create-schema

–skip-create-schema
mysqlslap: No user supplied data to insert or –auto-generate-sql specified!

trashes schema

I’ll be using the MySQL Sakila Sample Database.

[arabx@web1 sql]$ mysqlslap -P3307 -hlocalhost.localdomain -uroot –auto-generate-sql Seconds to load data: 0.08929
Number of clients loading data: 1
Number of inserts per client: 0
Seconds to run all queries: 0.23113
Number of clients running queries: 1
Number of queries per client: 1000

mysql -P3307 -hweb1.onegreendog.com -usakila -psakila sakila

mysqlslap -P3307 -hlocalhost.localdomain -uroot –create=schema.sql
mysqlslap: No user supplied data to insert or –auto-generate-sql specified!
[arabx@web1 sql]$ mysql -P3307 -hlocalhost.localdomain -uroot mysqlslap

Syntax

$ mysqlslap -?
mysqlslap  Ver 0.1 Distrib 5.1.4-alpha, for pc-linux-gnu (i686)
Copyright (C) 2005 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL        license

Run a query multiple times against the server

Usage: mysqlslap [OPTIONS]

Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf
The following groups are read: mysqlslap client
The following options may be given as the first argument:
–print-defaults        Print the program argument list and exit
–no-defaults           Don’t read default options from any options file
–defaults-file=#       Only read default options from the given file #
–defaults-extra-file=# Read this file after the global files are read
  -a, –auto-generate-sql
                      Generate SQL where not supplied by file or command line.
  -C, –compress      Use compression in server/client protocol.
  -l, –concurrency-load=#
                      Number of clients to use when loading data.
  -c, –concurrency=# Number of clients to simulate for query to run.
  –create=name       File or string to use for create.
  -d, –data=name     File or string with INSERT to use for populating data.
  -#, –debug[=name]  Output debug log. Often this is ‘d:t:o,filename’.
  -F, –delimiter=name
                      Delimiter to use in SQL statements supplied in file or
                      command line.
  -D, –drop-schema   Drop schema if it exists prior to running and after
                      running.
  -e, –engine=name   Storage engine to use for creating the table.
  -?, –help          Display this help and exit.
  -h, –host=name     Connect to host.
  -i, –iterations=#  Number of iterations.
  -x, –number-char-cols=#
                      Number of INT columns to create table with if specifying
                      –sql-generate-sql.
  -y, –number-int-cols=#
                      Number of VARCHAR columns to create table with if
                      specifying –sql-generate-sql.
  -n, –number-rows=# Number of rows to insert when loading data.
  -p, –password[=name]
                      Password to use when connecting to server. If password is
                      not given it’s asked from the tty.
  -P, –port=#        Port number to use for connection.
  –protocol=name     The protocol of connection (tcp,socket,pipe,memory).
  -A, –skip-create-schema
                      Don’t create a schema, use existing schema.
  -L, –skip-data-load
                      Don’t load any data, use existing data set.
  -Q, –skip-query    Don’t run any queries.
  -s, –silent        Run program in silent mode - no output.
  -q, –query=name    Query to run or file containing query to run.
  -S, –socket=name   Socket file to use for connection.
  -u, –user=name     User for login if not current user.
  -v, –verbose       More verbose output; You can use this multiple times to
                      get even more verbose output.
  -V, –version       Output version information and exit.
Posted under General on 10 Feb 2006
Comments (0)
Feb
05

Google might and the loss of power to the underdogs

Link to this post

In doing some Internet Searching I came across an interesting feature on the IBM DeveloperWorks Web Site. For the purposes of this demonstration, I’ve done some more testing to make it easier to demonstrate.

DeveloperWorks in response to a Google Search, prompts the user within the page to continue searching the IBM site with the same search criteria entered from the Google Search. In theory this would not be complicated, this referrer information is available and used in most Web Stats programs that troll log files and then provide a Section showing Search Engine Terms that directed traffic to your site.

What I surprised about, is that IBM (A large company, and key open-source proponent), restricts this functionality to Google Only. Check this out.

For each Search engine in our test, we are going to go to the respective search page, and enter the term IBM Federated Database Technology.

As a result, most search engines should provide a reference to the article at http://www-128.ibm.com/developerworks/db2/library/techarticle/0203haas/0203haas.html in the top results. We are then going to view this webpage from selecting the search results link.

The Search Engines I used were: Google · Altavista · Yahoo · Ask Jeeves · Excite



The code in effect is very simple, just some javascript.


if (document.referrer&&document.referrer!="") {
   // document.write(document.referrer);
   var q = document.referrer;
   var engine = q;
   var isG = engine.search(/google\.com/i);
   var searchTerms;
   //var searchTermsForDisplay;
   if (isG != -1) {
	   var i = q.search(/q=/);
	   var q2 = q.substring(i+2);
	   var j = q2.search(/&/);
	   j = (j == -1)?q2.length:j;
	   searchTerms = q.substring(i+2,i+2+j);
	   if (searchTerms.length != 0) {
	       searchQuery(searchTerms);
	       document. write("<div id=\"contents\"></div>");
	   }
   }
}
Posted under General on 05 Feb 2006
Comments (0)
Home
  • « Jan spinner iCalendar Mar »
    February 2006
    M T W T F S S
     12345
    6789101112
    13141516171819
    20212223242526
    2728EC
  • Categories:
    • Personal
      • Australian Culture
      • Cool Stuff
      • General
        • Humour
        • Quote of the Day
        • The Daily WTF
      • German Experience
      • Passion & Dreams
      • Photos
        • Pan Photos
      • US Adventure
        • Cricket World Cup
        • iPhone
        • MacBook
      • Vehicle Plates
      • Videos
      • Writing

  • Archives:
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • September 2005
    • July 2005
    • August 2004
    • June 2004