3/29/2006, 8:59 pm
Kubuntu has been a rough road so far. Most things work right out of the box but it’s missing a way to install most of the common dev packages. The stable tree seems to be missing a lost of common libs (ones that are even available in suse). I had to install all the auto*, gcc and friends by hand. In SuSE this was done by the all encompassing development group selection.I’m getting he hang of switching to the ‘universe’ tree when I can’t find something on stable. Adept, the apt-get gui is very eash to use. My one complaint is that when it detects a broken dependency it won’t tell me what’s broken.
One thing I love about kubuntu and what spawned this post is the ipasq package/script. It’s not flashy and it doesn’t have a lot of output but it _just works_. Literally. I have been dreading setting up ip forwarding on this box for a few days because it’s normally a big pain in the ass. After a few minutes of searching yahoo I found the ipmasq package. I installed it and ran it. It spit about a bunch of permissions errors from iptables. Then I ran it with sudo. I was expecting another error prompting for interfaces what I got as nothing but amazement. It didn’t output anything but windows in vmware suddenly started connecting. Never before has it been so easy to setup ipmasquerading. Thank you ipmasq and who ever built it. You are truly great.
3/26/2006, 4:19 pm
SuSE 10 has failed me. It seems that every new suse release is further behind in kde package version and is lacking another geek package. I end up putting in extra suse sources and searching all over the net for things I want to use. Sorry SuSE, my old friend, it’s time to say good bye. Your default prompts no longer contain the leet aliases of old suse versions. Granted I can just copy my bash profile before upgrading but that’s not the point. SuSE is moving away from a friendly-to-geek-and-normal-user-alike distro to… well… crap. YaST still can’t handle parsing the protocol and path for a source. Several times I have searched yast for packages that existed in 9.3 but have since been removed (Don’t flame me for not having examples. Just trust me that it happens). I have tried fedora in the past but never got used to up2date. Gentoo is a disaster. I won’t get started on source based distros just see funroll-loops.org While I’m writing this my laptop is burning ubuntu. I will let you know how it goes. Feel free to turn this post into a distro flame war with three rules. No fedora, no gentoo, and no suse. Flame on!
3/26/2006, 3:02 pm
Have you ever tried to take a snapshot from a mysql server only to find an hour later that the box ran out of disk space when trying to create the tar ball? An easy solution is to use ssh to pipe the tar data directly to another server without it even touching the disk. For those unfamiliar with unix shells or pipes a pipe allows you to tie the output of one program to the input of another. This is most commonly used to manipulate that stream of data. For example if you want to find a specific file in a directory. In these examples cartman is server A (where the commands are ran from). Stan is server B.
cartman> ls | grep mysql-5
mysql-5.0
The | (pipe) tells the shell to direct the output of ls to the input of grep which looks for the pattern ‘mysql-5′. This same functionality can be used with the tar command. This next command would compress a file and uncompress it on itself. Of course this is pointless. Until we add in ssh
cartman> tar -cf – mysql-5 | tar -xf -
With ssh we can pipe data to another server without it being written to the local disk. If the same users and (uids) exist on both systems tar will even preserve the owner and permissions of the file which is exactly what we want for a mysql snapshot.
cartman> tar -cvf – mysql-5 | ssh stan ‘ tar -xf -’
You can of course add in calls to cd and sudo to preserve user permissions and make sure the snapshot ends up in the correct dir.
cartman> cd /usr/local/mysql; tar -cvf – data | ssh stan ‘cd /usr/local/mysql; sudo tar -xf -’
Just to confuse you this can also be ran the other way. From stan to cartman. Think of this as reaching over to the other server and pulling a file through.
stan> ssh cartman ‘cd store/mysql/; tar -cf – mysql-4.1.15.tar.gz’ | tar -xf -
This can also be used to speed up scp command that involve lots of small files. Tar will produce a stream of output which can be sent across the network in much larger blocks than the native scp protocol which will send a small packet for each file if the file is small enough. The linux command line contains hundreds of different tools that can be combined in millions (billions? trillions?) of different ways to easily accomplish tasks. I have been using linux for years and am still learning new shell tricks almost daily. If you’re an old school shell guy please add a comment with your favorite shell tricks.
3/6/2006, 6:43 pm
While reading planetmysql.org I ran across this Tune a MySQL server in 5 minutes.. I think that entry is really missing a lot in terms of actual tuning for the real world. Also I thought max_user_connections is number of connections per hour. Since I only have 3 minutes I can’t look it up! You probably don’t want to set this with apache.
So here in three minutes are the four variables you really need and some generic guidlines for setting them. This assumes that MySQL is running on it’s own server and has one apache server connecting to it.
max_connections – set to the same (or a little bigger than) as MaxChildren from apache if you’re only using one mysql connection per request (this is most common)
key_buffer_size – Set to roughly half your available ram. Remember this is a quick and dirty tuning. We only have 3 minutes!
thread_cache_size – set it until show status like ‘threads_created’ quits increasing.
table_cache_size – set until show status like ‘opened_tables’ quits increasing. If you have thousands of tables this might not be possible
It took me 5 mintues to write this entry so you should be able to implement it in 3 (ok maybe five or six). For a MySQL server serving only MyISAM tables this style of configuration will be good enough.