In order to spread the load and increase capacity I was trying to move the MySQL server to another computer with the main server handling the web and the second server running the MySQL database. Even though I have 8 gigs of ram in the main server every now and then for some reason I can’t explain memory usage soars the the server quits working due to high load.Most all applications talk to MySQL through “localhost” that resolves to IP address 127.0.0.1 port 3306. Normally moving this service is trivial. I just shut down the database on the main server, move the database to another server, start it up there. Then I set up an SSH tunnel that pipes requests from the main server to the new server by intercepting requests and transporting them over TCP. Generally this just works.
However – the morons at MySQL decided to redefine the meaning of “localhost” and when an application uses “localhost” the client libraries force it to be redirected to talk to the Unix socket /var/lib/mysql/mysql.sock instead of the TCP port. Why they did this is crazy beyond belief but there’s no way to override it short of downloading the source code and fixing it and recompiling MySQL which is the standard answer that you get whenever you complain too much about Open Source.
I however don’t give up so easily. I found a Linux utility called “socat” (socket concatenate ?) that allowed me to create a fake Unix socket and pipe it to a TCP port. And it worked – for a while. But it wasn’t reliable. As long as I was awake and in front of the computer it worked fine. But as soon as I went to sleep it shut down. So I wake up to a mailbox full of “my web site is down”.
So – I put it back on the main server till I find a real solution.
But – this is yet another example of why open source will never fully replace paid for software. If you have a commercial product people can call up the vendor and scream at them to fix bugs. When I sold commercial software and someone called me needing something fixed or added I usually had it the same day. However in the open source world you have a lot of people who have a highly inflated sense of importance who think their software is the greatest thing that was ever written and it’s crap!
What it comes down to as far as I can tell is the VI editor that comes with Unix causes brain damage. I’m totally serious about this. The VI editor absolutely sucks. It’s years behind editors I got with DOS 20 years ago and is an example of how to make an interface that totally sucks. I have refused to learn this editor because I find it offensive. I do most all my editing with a Windows editor, Textpad, and I run Samba on the Linux boxes so that I can mount them from Windows. That’s because there are no good editors in the Linux world. Other than that I use Pico which is a great little Unix editor for quick and dirty but still isn’t up to the kind of power I had in DOS or even CP/M (Wordstar) which is a better editor that any text mode editor in the Unix world.
I’m still waiting for Linux to catch up to CP/M!!!
My theory is that when people use VI it lowers their standards as to what good software should look like and causes their minds to physically alter in a way that leads to VI syndrome leading to delusions that their little piece of shit software is the greatest program in the world and that they are just so superior to microsoft that it’s just a matter of days before Microsoft collapses and everyone accepts Linux as God.
But what the open source world doesn’t get is that Windows programs actually WORK! If you want to install a windows application you download it, click NEXT, AGREE, NEXT, NEXT, NEXT, FINISH and the program is running. In the Linux world this almost never happens and when it does you’re almost sure that something has to be wrong. In Linux you have to edit cryptic config files with poor documentation. Then you try to run the application, get an error, Google the error, and go back and edit again. After many hours you might have it working or you might have to give up.
Out here in the real world localhost = 127.0.0.1 everywhere EXCEPT in MySQL. Not only did they hard code the bizarre behavior but have no way to override it. In fact they do the opposite. Whatever you set the configuration to they override it and force you to use the Unix socket. So doing something that should be simple becomes a nightmare. And you can’t talk to them because they have VI syndrome.