Hi, Martin,
The DTrace probes in MySQL 6.0.4 works fine, and it provide very useful online
information for query execution time; in addition, it provide execution time of
queries being replicated to help understand the replication load and manage the
replication lag.
But I think it would be more interesting and useful to add more parameters into
the probes such as reporting the SQL statement, etc.
For example, after the following changes, the probes can report the execution
time for each sql statements:
"probes.d"
provider mysql {
probe update_start(char *);
probe update_end(char *);
...
}
in "sql_update.cc"
insert: MYSQL_UPDATE_START(thd->query)/MYSQL_UPDATE_END(thd->query)
And after the above changes and recompilation with --enable-dtrace, I can run
the following test script to get the query execution time replicated from the
master by the slave's sql thread:
#cat ./mysql_update.d
#!/usr/sbin/dtrace -s
dtrace:::BEGIN
{
printf(" %5s %s \n", "query exetion(ms)","QUERY");
}
mysql*:::update_start
{
self->start = timestamp;
}
mysql*:::update_end
/self->start/
{
this->elapsed = (timestamp - self->start) /1000000;
printf("%3d %-32.32s\n", this->elapsed, copyinstr(arg0));
self->start = 0;
}
#./mysql_update.d
query execution(ms) QUERY
15694 update sbtest set k=13;
...
Thanks,
Luojia(Jenny) Chen
Software Engineer
ISV Engineering
v-mail:(510) 550-2394
SUN Microsystems
----- Original Message -----
From: Martin MC Brown <[email protected]>
Date: Saturday, March 15, 2008 7:37 am
Subject: Re: [webstack-discuss] [Fwd: Re: [dtrace-discuss] DTrace for MySQL?]
To: Luojia Chen <Luojia.Chen at Sun.COM>
Cc: Manyi Lu <Manyi.Lu at Sun.COM>, webstack-discuss at opensolaris.org
> Hi,
>
> After an email from from Jenny, I checked the binary downloads and
> discovered that the DTrace probes in MySQL 6.0.4 are not enabled by
>
> default in the binary distributions.
>
> To use the supplied DTrace probes, you will need to download and
> compile the source and make sure that --enable-dtrace option is used
>
> for configure.
>
> MC
>
> On 11 Mar 2008, at 22:52, Luojia Chen wrote:
>
> > Hi,
> >
> > Yes, the 6.0.4-alpha includes a few probes:
> >
> > provider mysql {
> > probe external_lock(int);
> > probe insert_row_start();
> > probe insert_row_end();
> > probe filesort_start();
> > probe filesort_end();
> > probe delete_start();
> > probe delete_end();
> > probe insert_start();
> > probe insert_end();
> > probe select_start();
> > probe select_end();
> > probe update_start();
> > probe update_end();
> > };
> >
> > Thanks,
> >
> > Luojia(Jenny) Chen
> > Software Engineer
> > ISV Engineering
> > v-mail:(510) 550-2394
> > SUN Microsystems
> >
> > ----- Original Message -----
> > From: Manyi Lu <Manyi.Lu at Sun.COM>
> > Date: Tuesday, March 11, 2008 11:46 am
> > Subject: Re: [webstack-discuss] [Fwd: Re: [dtrace-discuss] DTrace
>
> > for MySQL?]
> > To: webstack-discuss at opensolaris.org
> >
> >
> >> Martin and all,
> >>
> >> Do you know whether the newly published MySQL 6.0.4-alpha has
> >> Dtrace probes in it?
> >>
> >> Thanks,
> >> Manyi
> >> This message posted from opensolaris.org
> >>
> >> _______________________________________________
> >>
> >>
> >> webstack-discuss mailing list
> >> webstack-discuss at opensolaris.org
> >> http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
> >>
> > _______________________________________________
> >
> >
> > webstack-discuss mailing list
> > webstack-discuss at opensolaris.org
> > http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
> >
>
> --
> Martin 'MC' Brown, mc at mcslp.com
> Everything MCslp: http://planet.mcslp.com
>
>
> _______________________________________________
>
>
> webstack-discuss mailing list
> webstack-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
>