import sysbench:
SysBench is a modular, cross-platform and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load. The idea of this benchmark suite is to quickly get an impression about system performance without setting up complex database benchmarks or even without installing a database at all. Current features allow to test the following system parameters: * file I/O performance * scheduler performance * memory allocation and transfer speed * POSIX threads implementation performance * database server performance (OLTP benchmark) Primarily written for MySQL server benchmarking, SysBench will be further extended to support multiple database backends, distributed benchmarks and third-party plug-in modules. from Jung (maintainer) with some tweaks. thanks to landry@ for testing and feedback. ok landry
This commit is contained in:
parent
7e320765fa
commit
8455372320
58
benchmarks/sysbench/Makefile
Normal file
58
benchmarks/sysbench/Makefile
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# $OpenBSD: Makefile,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $
|
||||||
|
|
||||||
|
COMMENT = A modular, cross-platform and multi-threaded benchmark tool
|
||||||
|
DISTNAME = sysbench-0.4.8
|
||||||
|
CATEGORIES = benchmarks
|
||||||
|
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=sysbench/}
|
||||||
|
|
||||||
|
HOMEPAGE = http://sysbench.sourceforge.net/
|
||||||
|
|
||||||
|
# GPL
|
||||||
|
PERMIT_DISTFILES_CDROM =Yes
|
||||||
|
PERMIT_DISTFILES_FTP = Yes
|
||||||
|
PERMIT_PACKAGE_CDROM = Yes
|
||||||
|
PERMIT_PACKAGE_FTP = Yes
|
||||||
|
WANTLIB = m c pthread
|
||||||
|
|
||||||
|
MAINTAINER = Jung <moorang@gmail.com>
|
||||||
|
|
||||||
|
BUILD_DEPENDS = ::textproc/libxslt \
|
||||||
|
::textproc/docbook-xsl
|
||||||
|
NO_REGRESS = Yes
|
||||||
|
|
||||||
|
CONFIGURE_STYLE = gnu
|
||||||
|
CONFIGURE_ENV = PREFIX=${PREFIX}
|
||||||
|
|
||||||
|
USE_GMAKE = yes
|
||||||
|
USE_LIBTOOL = yes
|
||||||
|
|
||||||
|
FLAVORS = mysql pgsql
|
||||||
|
FLAVOR ?=
|
||||||
|
|
||||||
|
.if ${FLAVOR:L:Mmysql}
|
||||||
|
CONFIGURE_ARGS += --with-mysql
|
||||||
|
LIB_DEPENDS += lib/mysql/mysqlclient_r.>=10::databases/mysql
|
||||||
|
WANTLIB += crypto ssl z
|
||||||
|
.else
|
||||||
|
CONFIGURE_ARGS += --with-mysql=no
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.if ${FLAVOR:L:Mpgsql}
|
||||||
|
CONFIGURE_ARGS += --with-pgsql
|
||||||
|
LIB_DEPENDS += pq.>=3:postgresql-client-*:databases/postgresql
|
||||||
|
#crypto ssl
|
||||||
|
.else
|
||||||
|
CONFIGURE_ARGS += --with-pgsql=no
|
||||||
|
.endif
|
||||||
|
|
||||||
|
pre-configure:
|
||||||
|
@rm ${WRKBUILD}/doc/manual.html
|
||||||
|
|
||||||
|
do-install:
|
||||||
|
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/sysbench
|
||||||
|
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/sysbench
|
||||||
|
${INSTALL_DATA} ${WRKBUILD}/doc/manual.html ${PREFIX}/share/doc/sysbench
|
||||||
|
${INSTALL_PROGRAM} ${WRKBUILD}/sysbench/sysbench ${PREFIX}/bin
|
||||||
|
${INSTALL_SCRIPT} ${WRKBUILD}/scripts/sb_*.sh ${PREFIX}/share/examples/sysbench
|
||||||
|
|
||||||
|
.include <bsd.port.mk>
|
5
benchmarks/sysbench/distinfo
Normal file
5
benchmarks/sysbench/distinfo
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
MD5 (sysbench-0.4.8.tar.gz) = 2he5ZU7Hy468C4qAYqQdzg==
|
||||||
|
RMD160 (sysbench-0.4.8.tar.gz) = p9Joal/gF7jRcP5Dh5RGLBxc2QI=
|
||||||
|
SHA1 (sysbench-0.4.8.tar.gz) = 2/d9mNk5nu7PDZ6Bxyoopd7iz1g=
|
||||||
|
SHA256 (sysbench-0.4.8.tar.gz) = VlNmLgNxx9s8/sD1xnGSZtkiev+0zOvV0gZnWtmC+KY=
|
||||||
|
SIZE (sysbench-0.4.8.tar.gz) = 469327
|
12
benchmarks/sysbench/patches/patch-configure
Normal file
12
benchmarks/sysbench/patches/patch-configure
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
$OpenBSD: patch-configure,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $
|
||||||
|
--- configure.orig Tue Apr 15 11:36:17 2008
|
||||||
|
+++ configure Tue Apr 15 11:36:48 2008
|
||||||
|
@@ -19859,7 +19859,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||||
|
XSLTPROC_FLAGS=--nonet
|
||||||
|
DOCBOOK_ROOT=
|
||||||
|
if test ! -f /etc/xml/catalog; then
|
||||||
|
- for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
|
||||||
|
+ for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/ ${PREFIX}/share/xsl/docbook/xhtml;
|
||||||
|
do
|
||||||
|
if test -d "$i"; then
|
||||||
|
DOCBOOK_ROOT=$i
|
12
benchmarks/sysbench/patches/patch-doc_Makefile_in
Normal file
12
benchmarks/sysbench/patches/patch-doc_Makefile_in
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
$OpenBSD: patch-doc_Makefile_in,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $
|
||||||
|
--- doc/Makefile.in.orig Tue Apr 15 12:13:50 2008
|
||||||
|
+++ doc/Makefile.in Tue Apr 15 12:14:17 2008
|
||||||
|
@@ -193,7 +193,7 @@ target_os = @target_os@
|
||||||
|
target_vendor = @target_vendor@
|
||||||
|
XHTML_STYLESHEET = $(srcdir)/xsl/xhtml.xsl
|
||||||
|
CHUNK_XHTML_STYLESHEET = $(srcdir)/xsl/xhtml-chunk.xsl
|
||||||
|
-XML_CATALOG_FILES = xsl/catalog.xml
|
||||||
|
+XML_CATALOG_FILES = ${PREFIX}/share/xsl/docbook/catalog.xml
|
||||||
|
htmldir = $(prefix)/share/doc/sysbench
|
||||||
|
dist_html_DATA = manual.html
|
||||||
|
EXTRA_DIST = manual.xml xsl/catalog.xml.in xsl/xhtml-chunk.xsl xsl/xhtml-common.xsl xsl/xhtml.xsl
|
44
benchmarks/sysbench/patches/patch-scripts_sb_run_sh
Normal file
44
benchmarks/sysbench/patches/patch-scripts_sb_run_sh
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
$OpenBSD: patch-scripts_sb_run_sh,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $
|
||||||
|
--- scripts/sb_run.sh.orig Tue Jan 31 11:15:49 2006
|
||||||
|
+++ scripts/sb_run.sh Tue Apr 15 12:52:29 2008
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-#!/bin/bash
|
||||||
|
+#!/bin/sh
|
||||||
|
# File: sb_run.sh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2004 Alexey Kopytov & MySQL AB
|
||||||
|
@@ -7,10 +7,10 @@ sbname=sysbench
|
||||||
|
|
||||||
|
#Install signals handlers
|
||||||
|
trap 'echo "Got SIGINT, exiting..."; \
|
||||||
|
- killall vmstat; killall iostat; killall mpstat' INT
|
||||||
|
+ pkill vmstat; pkill iostat' INT
|
||||||
|
|
||||||
|
trap 'echo "Got SIGTERM, exiting..."; \
|
||||||
|
- killall vmstat; killall iostat; killall mpstat' TERM
|
||||||
|
+ pkill vmstat; pkill iostat' TERM
|
||||||
|
|
||||||
|
|
||||||
|
# First try to find SysBench in the current dir
|
||||||
|
@@ -83,13 +83,13 @@ RUN_NUMBER=`expr $RUN_NUMBER + 1`
|
||||||
|
echo $RUN_NUMBER > .run_number
|
||||||
|
|
||||||
|
# Start vmstat
|
||||||
|
-nohup vmstat -n $UPDATES_INTERVAL >$OUTPUT_DIR/vmstat.out 2>&1 &
|
||||||
|
+nohup vmstat $UPDATES_INTERVAL >$OUTPUT_DIR/vmstat.out 2>&1 &
|
||||||
|
|
||||||
|
# Start iostat
|
||||||
|
nohup iostat $UPDATES_INTERVAL >$OUTPUT_DIR/iostat.out 2>&1 &
|
||||||
|
|
||||||
|
# Start mpstat
|
||||||
|
-nohup mpstat $UPDATES_INTERVAL >$OUTPUT_DIR/mpstat.out 2>&1 &
|
||||||
|
+# nohup mpstat $UPDATES_INTERVAL >$OUTPUT_DIR/mpstat.out 2>&1 &
|
||||||
|
|
||||||
|
cat >$OUTPUT_DIR/desc.txt <<EOF
|
||||||
|
$sbname command line args: $sbpath $sbargs
|
||||||
|
@@ -101,4 +101,4 @@ echo "Running $sbpath $sbargs"
|
||||||
|
|
||||||
|
$sbpath $sbargs >$OUTPUT_DIR/sysbench.out 2>&1
|
||||||
|
|
||||||
|
-killall vmstat; killall iostat; killall mpstat
|
||||||
|
+pkill vmstat; pkill iostat
|
38
benchmarks/sysbench/patches/patch-scripts_sb_test_ps_sh
Normal file
38
benchmarks/sysbench/patches/patch-scripts_sb_test_ps_sh
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
$OpenBSD: patch-scripts_sb_test_ps_sh,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $
|
||||||
|
--- scripts/sb_test_ps.sh.orig Tue Jan 31 11:15:49 2006
|
||||||
|
+++ scripts/sb_test_ps.sh Tue Apr 15 14:09:01 2008
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-#!/bin/bash
|
||||||
|
+#!/bin/sh
|
||||||
|
# File: sb_test_ps.sh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2004 Alexey Kopytov & MySQL AB
|
||||||
|
@@ -25,23 +25,24 @@ run_test()
|
||||||
|
{
|
||||||
|
tname="$1"
|
||||||
|
sbargs="--num-threads=$NUM_THREADS --max-requests=0 --max-time=60 \
|
||||||
|
---test=oltp --oltp-table-size=100000 --mysql-table-type=myisam \
|
||||||
|
+--test=oltp --oltp-table-size=100000 --mysql-table-engine=myisam \
|
||||||
|
--oltp-point-selects=$point_selects \
|
||||||
|
--oltp-simple-ranges=$simple_ranges
|
||||||
|
--oltp-sum-ranges=$sum_ranges
|
||||||
|
--oltp-order-ranges=$order_ranges
|
||||||
|
--oltp-distinct-ranges=$distinct_ranges
|
||||||
|
--oltp-index-updates=$index_updates
|
||||||
|
---oltp-non-index-updates=$non_index_updates"
|
||||||
|
+--oltp-non-index-updates=$non_index_updates
|
||||||
|
+--db-driver=mysql"
|
||||||
|
|
||||||
|
echo -e "\n*** Running test for $tname (client-side PS) ***\n"
|
||||||
|
sysbench $sbargs prepare >/dev/null
|
||||||
|
- sb_run.sh -c "$tname (client-side PS)" $sbargs --db-ps-mode=disable run
|
||||||
|
+ $sbrun -c "$tname (client-side PS)" $sbargs --db-ps-mode=disable run
|
||||||
|
sysbench $sbargs cleanup >/dev/null
|
||||||
|
|
||||||
|
echo -e "\n*** Running test for $tname (server-side PS)... ***\n"
|
||||||
|
sysbench $sbargs prepare >/dev/null
|
||||||
|
- sb_run.sh -c "$tname (server-side PS)" $sbargs run
|
||||||
|
+ $sbrun -c "$tname (server-side PS)" $sbargs run
|
||||||
|
sysbench $sbargs cleanup >/dev/null
|
||||||
|
}
|
||||||
|
|
44
benchmarks/sysbench/patches/patch-sysbench_sb_logger_c
Normal file
44
benchmarks/sysbench/patches/patch-sysbench_sb_logger_c
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
$OpenBSD: patch-sysbench_sb_logger_c,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $
|
||||||
|
--- sysbench/sb_logger.c.orig Mon Apr 3 12:39:09 2006
|
||||||
|
+++ sysbench/sb_logger.c Tue Apr 15 12:10:58 2008
|
||||||
|
@@ -441,15 +441,17 @@ int oper_handler_init(void)
|
||||||
|
|
||||||
|
if (batch_mode)
|
||||||
|
{
|
||||||
|
+ int err;
|
||||||
|
pthread_mutex_init(&batch_mutex, NULL);
|
||||||
|
pthread_cond_init(&batch_cond, NULL);
|
||||||
|
|
||||||
|
/* Create batch thread */
|
||||||
|
pthread_attr_init(&batch_attr);
|
||||||
|
- if (pthread_create(&batch_thread, &batch_attr, &batch_runner_proc, NULL)
|
||||||
|
- != 0)
|
||||||
|
+ if ((err = pthread_create(&batch_thread, &batch_attr,
|
||||||
|
+ &batch_runner_proc, NULL)) != 0)
|
||||||
|
{
|
||||||
|
- log_errno(LOG_FATAL, "Batch thread creation failed");
|
||||||
|
+ log_text(LOG_FATAL, "Batch thread creation failed errno = %d (%s)",
|
||||||
|
+ err, strerror(err));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
batch_status = BATCH_STATUS_STOP;
|
||||||
|
@@ -541,15 +543,17 @@ int oper_handler_done(void)
|
||||||
|
|
||||||
|
if (batch_mode)
|
||||||
|
{
|
||||||
|
+ int err;
|
||||||
|
/* Stop the batch thread */
|
||||||
|
pthread_mutex_lock(&batch_mutex);
|
||||||
|
batch_status = BATCH_STATUS_STOP;
|
||||||
|
pthread_cond_signal(&batch_cond);
|
||||||
|
pthread_mutex_unlock(&batch_mutex);
|
||||||
|
|
||||||
|
- if (pthread_join(batch_thread, NULL))
|
||||||
|
+ if ((err = pthread_join(batch_thread, NULL)))
|
||||||
|
{
|
||||||
|
- log_errno(LOG_FATAL, "Batch thread join failed");
|
||||||
|
+ log_text(LOG_FATAL, "Batch thread join failed errno = %d (%s)",
|
||||||
|
+ err, strerror(err));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
44
benchmarks/sysbench/patches/patch-sysbench_sysbench_c
Normal file
44
benchmarks/sysbench/patches/patch-sysbench_sysbench_c
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
$OpenBSD: patch-sysbench_sysbench_c,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $
|
||||||
|
--- sysbench/sysbench.c.orig Tue Jan 31 11:15:53 2006
|
||||||
|
+++ sysbench/sysbench.c Tue Apr 15 12:10:58 2008
|
||||||
|
@@ -423,12 +423,14 @@ int run_test(sb_test_t *test)
|
||||||
|
/* Starting the test threads */
|
||||||
|
for(i = 0; i < sb_globals.num_threads; i++)
|
||||||
|
{
|
||||||
|
+ int err;
|
||||||
|
if (sb_globals.error)
|
||||||
|
return 1;
|
||||||
|
- if (pthread_create(&(threads[i].thread), &thread_attr, &runner_thread,
|
||||||
|
- (void*)&(threads[i])) != 0)
|
||||||
|
+ if ((err = pthread_create(&(threads[i].thread), &thread_attr,
|
||||||
|
+ &runner_thread, (void*)&(threads[i]))) != 0)
|
||||||
|
{
|
||||||
|
- log_errno(LOG_FATAL, "Thread #%d creation failed", i);
|
||||||
|
+ log_text(LOG_FATAL, "Thread #%d creation failed errno = %d (%s)",
|
||||||
|
+ i, err, strerror(err));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -437,9 +439,11 @@ int run_test(sb_test_t *test)
|
||||||
|
log_text(LOG_INFO, "Threads started!");
|
||||||
|
for(i = 0; i < sb_globals.num_threads; i++)
|
||||||
|
{
|
||||||
|
- if(pthread_join(threads[i].thread, NULL))
|
||||||
|
+ int err;
|
||||||
|
+ if((err = pthread_join(threads[i].thread, NULL)))
|
||||||
|
{
|
||||||
|
- log_errno(LOG_FATAL, "Thread #%d join failed", i);
|
||||||
|
+ log_text(LOG_FATAL, "Thread #%d join failed errno = %d (%s)",
|
||||||
|
+ i, err, strerror(err));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -508,7 +512,7 @@ int init(void)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
- thread_stack_size = sb_get_value_int("thread-stack-size");
|
||||||
|
+ thread_stack_size = sb_get_value_size("thread-stack-size");
|
||||||
|
if (thread_stack_size <= 0)
|
||||||
|
{
|
||||||
|
log_text(LOG_FATAL, "Invalid value for thread-stack-size: %d.\n", thread_stack_size);
|
19
benchmarks/sysbench/pkg/DESCR
Normal file
19
benchmarks/sysbench/pkg/DESCR
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
SysBench is a modular, cross-platform and multi-threaded benchmark tool
|
||||||
|
for evaluating OS parameters that are important for a system running a
|
||||||
|
database under intensive load.
|
||||||
|
|
||||||
|
The idea of this benchmark suite is to quickly get an impression about
|
||||||
|
system performance without setting up complex database benchmarks or
|
||||||
|
even without installing a database at all.
|
||||||
|
|
||||||
|
Current features allow to test the following system parameters:
|
||||||
|
|
||||||
|
* file I/O performance
|
||||||
|
* scheduler performance
|
||||||
|
* memory allocation and transfer speed
|
||||||
|
* POSIX threads implementation performance
|
||||||
|
* database server performance (OLTP benchmark)
|
||||||
|
|
||||||
|
Primarily written for MySQL server benchmarking, SysBench will be
|
||||||
|
further extended to support multiple database backends, distributed
|
||||||
|
benchmarks and third-party plug-in modules.
|
7
benchmarks/sysbench/pkg/PLIST
Normal file
7
benchmarks/sysbench/pkg/PLIST
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
@comment $OpenBSD: PLIST,v 1.1.1.1 2008/04/15 14:14:08 sthen Exp $
|
||||||
|
bin/sysbench
|
||||||
|
share/doc/sysbench/
|
||||||
|
share/doc/sysbench/manual.html
|
||||||
|
share/examples/sysbench/
|
||||||
|
share/examples/sysbench/sb_run.sh
|
||||||
|
share/examples/sysbench/sb_test_ps.sh
|
Loading…
Reference in New Issue
Block a user