Bug #35327 sysbench couldn't run with libevent enabled
Submitted: 17 Mar 2008 2:53 Modified: 1 Oct 2009 20:38
Reporter: Xuekun Hu Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:6.0 BK OS:Linux (SLES10SP1 (2.6.16.46-0.12-smp, x64))
Assigned to: CPU Architecture:Any

[17 Mar 2008 2:53] Xuekun Hu
Description:
I tried both 6.0.4-alpha, 6.0.5-alpha (pulled from bk tree). When running sysbench simple test mode, sysbench didn’t exit, just print “Time limit exceeded, exiting...”, then sysbench hang. 

How to repeat:
MySQL was config with these options: CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure  --prefix=/home/mysql/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile  --enable-assembler --disable-shared --with-plugins=innobase --with-fast-mutexes --with-libevent 

And MySQL was started with thread_handling=pool-of-threads and thread_pool_size=20. 

Sysbench was run with “sysbench --num-threads=4 --max-time=20 --max-requests=1000000000 --mysql-table-engine=myisam --test=oltp --oltp-test-mode=simple --mysql-user=mysql --oltp-table-size=10000000 --mysql-socket=/tmp/mysql.sock run”

Hardware is Intel DP Woodcrest Dual-Core processor. OS is SLES10SP1 (2.6.16.46-0.12-smp, x64). 

Suggested fix:
N/A
[17 Mar 2008 19:02] Sveta Smirnova
Thank you for the report.

I can not repeat same behavior on test machine. Please provide sysbench ... prepare command and your error log file.
[18 Mar 2008 2:37] Xuekun Hu
I tried again on Fedora8, and myisam, innodb storage on the same machine. All same phenomena: sysbench didn't exit, no error log, cpus become idle. when I didn't usepool-of-threads model, sysbench can succeed. 

sysbench prepare command is "sysbench prepare --test=oltp --mysql-table-engine=myisam --oltp-table-size=10000000 --myisam-max-rows=10000000 --mysql-socket=/tmp/mysql.sock" 

my.cnf: 

[client]
port            = 3306
socket          = /tmp/mysql.sock

# The MySQL server
[mysqld]
user=mysql
concurrent_insert = 0
thread_handling=pool-of-threads
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 2048M
max_allowed_packet = 1M
table_open_cache = 10240
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
#query_cache_size = 32M
query_cache_type = 0
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 16
#thread_concurrency = 4
max_connections=3500
[5 Apr 2008 6:06] Xuekun Hu
Yes, not every time sysbench will fail. However in my setup, it would happen at very high frequency if run with more time. 

When the situation happened again, I used gdb to catch the backtrace

MySQL: 

Thread 18 (Thread 1133820224 (LWP 5796)):
#0  0x00002b4c0a9f2659 in syscall () from /lib64/libc.so.6
#1  0x000000000070704a in epoll_wait (epfd=1141436432, events=0x1af99, maxevents=-1, timeout=170628488) at epoll_sub.c:57
#2  0x0000000000706b9f in epoll_dispatch (base=0xc5df90, arg=<value optimized out>, tv=<value optimized out>) at epoll.c:197
#3  0x0000000000704d26 in event_base_loop (base=0xc5df90, flags=<value optimized out>) at event.c:440
#4  0x00000000005a312e in libevent_thread_proc (arg=<value optimized out>) at scheduler.cc:565
#5  0x00002b4c0a2b0143 in start_thread () from /lib64/libpthread.so.0
#6  0x00002b4c0a9f574d in clone () from /lib64/libc.so.6
#7  0x0000000000000000 in ?? ()

Sysbench: 

Thread 2 (Thread 1082132800 (LWP 1930)):
#0  0x00002b20c876994b in exit () from /lib64/libpthread.so.0
#1  0x0000000000447c1a in vio_read_buff (vio=0x6ddfa0, buf=0x6ec090 "\020", size=4) at viosocket.c:44
#2  0x0000000000448827 in my_real_read (net=0x6d7e80, complen=0x407ffc50) at net.c:820
#3  0x0000000000448b42 in my_net_read (net=0x3) at net.c:997
#4  0x0000000000443a12 in cli_safe_read (mysql=0x3) at client.c:658
#5  0x0000000000445354 in cli_read_query_result (mysql=0x3) at client.c:2629
#6  0x000000000041fc01 in cli_stmt_execute (stmt=0x6de1f0) at libmysql.c:2092
#7  0x0000000000420ed9 in mysql_stmt_execute (stmt=0x6de1f0) at libmysql.c:2479
#8  0x000000000041a8e9 in mysql_drv_execute (stmt=0x6de1a0, rs=0x701510) at drv_mysql.c:634
#9  0x00000000004127ef in db_execute (stmt=0x6de1a0) at db_driver.c:314
#10 0x00000000004181be in oltp_execute_request (sb_req=<value optimized out>, thread_id=0) at sb_oltp.c:1145
#11 0x000000000040f89d in runner_thread (arg=<value optimized out>) at sysbench.c:356
#12 0x00002b20c8763143 in start_thread () from /lib64/libpthread.so.0
#13 0x00002b20c8ff774d in clone () from /lib64/libc.so.6
#14 0x0000000000000000 in ?? ()

And I also enabled libevent debug. Here are the outputs: 
...
[debug] epoll_dispatch: epoll_wait reports 1
[debug] event_add: event: 0x2e49ef0, EV_READ   call 0x5a2ad0
[debug] event_base_loop: asked to terminate loop.
[debug] epoll_dispatch: epoll_wait reports 1
[debug] event_del: 0x2e49ef0, callback 0x5a2ad0
[debug] event_base_loop: asked to terminate loop.
[debug] epoll_dispatch: epoll_wait reports 1
[debug] event_add: event: 0x2e49ef0, EV_READ   call 0x5a2ad0
[debug] event_base_loop: asked to terminate loop.
[debug] epoll_dispatch: epoll_wait reports 1
[debug] event_del: 0x2e49ef0, callback 0x5a2ad0
[debug] event_base_loop: asked to terminate loop.
[debug] epoll_dispatch: epoll_wait reports 1
[debug] event_add: event: 0x2e49ef0, EV_READ   call 0x5a2ad0
[debug] event_base_loop: asked to terminate loop.

Hope these info useful. :-)
[1 Sep 2009 20:38] Sveta Smirnova
Thank you for the feedback.

Unfortunately all my tries to repeat this problem returned no luck. Also version 6.0 changed a lot since time when bug was created. Please try either version 6.0.11 or mysql-next from https://code.launchpad.net/~mysql/mysql-server/mysql-next and inform us if problem still exists in your environment.
[1 Oct 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".