All posts tagged unix

Memory leaks caused by PHP are hard to pinpoint. My server started crashing regularly, out of memory from running WordPress on Apache22 and FreeBSD. It happens especially when posting, but also at random times. I tried disabling plugins, changing the theme, to no avail. There might be more than one faulty script, and there is little hope to find these leaks. Hopefully they will be plugged in future releases. In the mean time, I wrote a Python script that checks memory status and restarts Apache if needed. Placed on a cron job, it runs every ten minutes on my server.:

It is a temporary fix, but it works. Her is my /etc/crontab line:
*/0 * * * * root /usr/local/bin/python /home/gil/scripts/mleaks.py

Good luck!

I got my first personal computer when I was 14, it was a ZX-81, with 1Kb of RAM. Yes, this is not a typo, 1Kb. There was no DOS at the time, certainly no PCs or Windows. When 3.1 came out, I was a bit disappointed, after seeing the Mac interface first, but adopted it nevertheless. More than two decades later, I was using XP for my desktop, and like everyone else, was pretty happy about it.

Then, last April, I decided to buy a new laptop. To my dismay, none were available with XP, so I got a Getaway with the new Vista on it. Problems started right away when I plugged-in my USB flash drive; instant crash! “Oh Well” I thought, that will probably be fixed in an update soon. Then, many programs I used simply did not run… The constant nagging of the OS got to me sometimes. I had all the pretty memory-consuming bells and whistles off, but the system would still freeze and be awfully slow, with 1Gb of RAM installed, and a dual-core Turion64 CPU; makes no sense at all…

The last straw was a regular disk cleanup. It was a cleanup all-right, my whole hard drive was wiped out! Vista erased itself, in a last moment of clarity, which turned out later as being the best thing it ever did. I packed my Vista CD and shipped it back to Microsoft to get a refund (wait until you find out how big a check they sent me!). In the meantime, I was trying to get an evaluation copy of X64 to run on my machine. Why not install a 64bit OS on a 64bit computer, right? Don’t do it! Not yet. Getting drivers was a nightmare, my SD card reader didn’t work, half of my USB ports didn’t work, and most of my software still didn’t work.

Just got a package from Microsoft! I thought it was maybe a Windows XP CD or a refund for Vista. I open the envelope, YES! There is a check in there: $1.39 (I double checked to make sure it wasn’t $139). They rob me, and now they insult me! I grabbed the phone, and after being on hold for a while and redirected a few times, I finally was able to explain my troubles, and got… Nothing. My software is “OEM” whatever the f**k that means, why should I care? The system says “Microsoft Vista,” not “Gateway Vista” or “Best Buy Vista.”

So, I find myself installing Ubuntu. The installation works fine, I answer a few questions, and what seems a fairly short time later, I am asked to reboot (note that you almost never have to reboot Linux after installing software). Startup sound! Sound works, I’m surprised I didn’t have to tinker with it. Holly Sh*t, I’m online! Ubuntu has found my wireless card all by itself. I don’t want to push my luck too far, but I’m about to try something I can’t dream will work (After trying on FreeBSD a few times and giving up), I plug in my USB printer… A few anxious seconds pass… Found it! ML1740, the test page spits out, incredible. I’m on a roll. I grab my digital camera, pop the SD card out and push it in the laptop card reader. Seconds later I am looking at my latest jam video, I don’t sound that great on the guitar, but it works. My key-chain follows, which is a USB flash drive, pop! On the screen. My head is spinning. This Ubuntu stuff works better than anything I’ve tried before. I am frantically trying to find something to plug-in, just to see if it works. Ah! My Ipod was trying to hide, pop! An Ipod icon appears on the screen. I need to go to the bathroom, but my Visor Edge PDA is laying on my night table. I install the cradle, push the Sync button, it synchronizes with my Evolution email client, all my Palm stuff is backed-up! All of this happened without having to install a single driver, tinker with any settings at all. I’m not saying you’ll never have to, but the Ubuntu forums are great for help, there is always someone with a ready answer.

I can say to Microsoft now, you have lost a customer. You are losing many because you didn’t care. Vista is in my opinion the worst operating system I have seen in 26 years of computing. This week I had to buy a new mouse for my desktop (It runs Ubuntu as well now), I went out of my way to buy a non-Microsoft mouse. I will never buy another Microsoft product. Linux is finally ready for the desktop, for home use and businesses.

Crappy Windows OS: $200. Ubuntu Linux: Priceless, literally!