Gentoo Archives: gentoo-performance

From: Javier Villavicencio <jvillavicencio@×××××××××.ar>
To: gentoo-user@l.g.o, gentoo-performance@l.g.o
Subject: [gentoo-performance] Implementing Optimization for Database Server - Nice story btw :+P
Date: Fri, 26 Nov 2004 04:52:50
Message-Id: 41A6B682.2050905@arnet.com.ar
1 First trying to revive the "benchmark these CFLAGS in a real-app with nice -n
2 -20" idea i had writing on this thread [1], and second showing some success on
3 my work and looking "not to do the same thing that someone else maybe already
4 did...", I'm posting this "experience" and a little question.
5
6 I where working with linux in various places over the time but all of those
7 "places" had policies and stuff about what kind of linux distribution they'll
8 use (or not use at all) so the only thing I could do with gentoo was "I use it
9 only on my machine". But now, I work in a complete mess of an extremely bad
10 directed "gouvernamental institution", one of those that makes use of
11 -INTENSIVE- processing power, but, looking for the minimal-lowest-nonexistent
12 "cost".
13
14 Sounds funny, right? :+)
15
16 Well here is when gentoo makes my life easier:
17 The "guy before me" was a fan of OpenBSD which I respect and still use as our
18 "internet" firewalls, but it really lacks of the support that everyone else
19 needed at work. A little example of this: They where working with databases in
20 "a couple" of RDBMSs: Gupta/Centura SQLBase, Oracle, Interbase, among others.
21 So... "how in the hell i can make a apache+mysql+php-THING work with these
22 databases on OBSD". just "no way" so before starting the real "web services"
23 they asked me to prove myself "migrating" some "non-cost-effective" M$ services,
24 as I did:
25
26 The hardware they have are some Fujistu-Siemens Primergy P470 servers, with
27 duals PentiumII or PentiumIII with no more than 500Mhz the P3 and 450Mhz the P2,
28 if I wanted 1Gb of ram they had this but wasn't necessary, and the only good
29 thing i liked about these where the hot-pluggable backplanes with Mylex DAC960
30 and DAC1100 SCSI-2 Raid controllers.
31
32 So I took my livecd and migrated 2 M$ systems and an old redhat: First was the
33 "internet S and A" server (ISA :+P) to squid->winbind/samba->w2kdomaingroups.
34 Then was the mailserver, which was a qmail installed from some sort of strange
35 script that downloads and compiles and installs and configured all by himself
36 without asking a sh*t, which had more than 3000 viruses incoming per week, now
37 it's a postfix+mysql+amavis+clamav+dspam solution made by myself (of course
38 following TONS of howtos :+P). And the last one was the webserver itself, which
39 was an "it need to be restarted every 4 hours" win2k with apache and php,and now
40 it can access ANY database that have an ODBC driver even in WINDOWS (using a
41 DBTCP proxy in a win2k machine google it, it's cool, i also patched the php
42 module to compile and added a pear module to access it from Pear DB.php ;+) from
43 php using apache and accessing oracle 8.1.7 and oracle 9.2.0.5.
44
45 So far, I didn't needed "great" optimization. CFLAGS like "-O2 -march=pentium3/2
46 -frename-registers -fomit-frame-pointers -pipe" did the magic very well.
47
48 But now "the time has come" X'D
49
50 I, now, have to make -THE- database server.
51
52 I already started it, but with -extra-safe-cflags-and-package-versions-, because
53 it should run Oracle 9.2.0.5 and you can find a lot of "troubles" rather than
54 "solutions" in non-certified (and in certified too btw) distributions where to
55 run oracle.
56
57 Now after 3 weeks of recovering dead disks, going for the S40 storage, and
58 compiling/downloading/installing everything to the tiniest detail....
59 it's working...
60
61 This is what I've got:
62
63 The computer have two PentiumIII 500Mhz with 1Gb of ECC RAM, and a total of 14
64 SCSI-2 hard disks (yes 14), 2 of them (9Gb each) in a raid1 (mirror)
65 configuration for the booting system (gentoo ;+) with reiserfs on a DAC960PRL
66 controller.
67 The other 12 are configured in this way: since the DAC1100 that connects the
68 server to the storage cannot handle in a single array pack more than 8 disks
69 this storage has 2 RAID5 configurations one made of 8 9Gb disks and the other
70 made of 4 18Gb disks, which I combined in three different "partitions" using
71 software raid0 (stripping) with a total of (around) 110Gb, divided into
72 60Gb/30Gb/20Gb (oracle users my guess this u01/u02/u03 :+) that holds the big
73 swap partition (2Gb outside the softraid) and, of course, will hold the
74 database. Since this is going to handle "big" files, it has XFS tuned
75 accordingly with Daniel Robbins suggestions ;+).
76
77 Now, regarding the original subject, I'm thinking about doing an emerge -e world
78 with new cflags, check if it breaks anything, if it works faster, if I can
79 extract all the juice this machines have, so I'm about to start "benchmarking"
80
81 But, taking in mind the -fact- that this wont recompile the oracle stuff (and
82 oracle doesn't compile anything on your machine, it just "links" stuff) I was
83 thinking about "forcing" some cflags to the glibc itself and other libs that may
84 oracle use that can be optimized "the gentoo way".
85
86 After this, I'm asking before I start this "adventure" X'D, if anyone, anybody
87 did something similar before, results, advices, CFLAGS!!!, even ~x86 stuff like
88 gcc3.4 if it doesn't break oracle ;+), kernel schedulers (staircase?, cfq?, and
89 io: anticipatory?, deadline?), kernel patches, anything (ideas, insults, flames
90 X'D) can be of help and will be appreciated.
91
92 (I may add that this is a sort of "competition" between me and the DBA, that
93 says: "the server must be a redhat 8, since oracle has certified it" and I say:
94 "the server must be tested first with gentoo since it will run faster and we
95 need speed on that old machines we have, and if it works solid, make the
96 switch"... So this will be (in the end) a benchmark with a title like this
97 "Indestructible Redhat-Oracle" vs "Fast-Bleeding-Edge Gentoo-Oracle".)
98
99 So, I hope the enthusiasm from all the gentoo users can help me win this little
100 battle ;+)
101
102 Thanks a lot for reading all of this, I know is very large, but I thought it
103 would be nice to make it known that gentoo is growing in scales like this :+)
104
105 Salu2,
106 Javier.
107
108 [1] http://forums.gentoo.org/viewtopic.php?p=1805512
109
110 --
111 gentoo-performance@g.o mailing list