[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MySQL on OpenBSD 3.0 is *much* better!

***** BEFORE  (OpenBSD 2.9 default ports install:) *******

My busy 1pm traffic USED to have MySQL taking 50-70% of CPU.

***** AFTER (OpenBSD 3.0 tweaked threads install:) ******* load averages: 0.38, 0.30, 0.26 24 processes: 1 running, 23 idle CPU states: 1.7% user, 13.4% nice, 6.2% system, 0.2% interrupt, 78.5% idle Memory: Real: 29M/204M act/tot Free: 552M Swap: 0K/1024M used/tot

16019 mysql      2    4   14M   14M sleep poll    42:56  7.57% mysqld
15816 www        2    0 1868K 3436K sleep netio    0:00  0.15% httpd

I went ahead and threw it on our live busy webserver yesterday.
(Entirely MySQL-driven website.)
It's holding up great.

Seems it was a threads problem?  Marco knows better than I.
(I'm just a user, not a developer.)

Instructions from Marco on how to do it:

THIS HAS TO BE DONE ON OPENBSD 3.0.  Won't work on any earlier version.

#1) update the thread lib (libc_r) to -current.
cd /usr/src/lib/libc_r
cvs -d anoncvs_(_at_)_some_(_dot_)_anon_(_dot_)_server:/cvs up -PAd

#2) compile and install the thread library
cd /usr/src/lib/libc_r
make cleandir
make obj
make depend
make install

#3)  go to /usr/ports/databases/mysql
and comment-out these lines in Makefile:
# CONFIGURE_ENV=        CPPFLAGS="-I${LOCALBASE}/include/pth" \
#                LDFLAGS="-L${LOCALBASE}/lib/pth"
# LIB_DEPENDS=  lib/pth/pthread.14:pth-1.4.*:devel/pth
# LIB_DEPENDS=  lib/pth/pthread.14:pth-1.4.*:devel/pth

#4) make mysql and then run the tests.
cd /usr/ports/databases/mysql
cd w-mysql-3.23.42/mysql-3.23.42/mysql-test

#5) try running live
cd /usr/ports/databases/mysql
make install