-
Speeding up Ruby
When I setup my store, I sued FastCGI to get acceptable performance which was fine as I don't get many hits. Today I installed BrowseBack because it came as part of the software bundle I purchase through MacHeist/MacUpdate. As I hit my store a lot to check stats and such, BrowseBack kept loading the store which spiked the server load to 4 and required me to kill BrowseBack to get my server back to normal. While this isn't normally a problem, it exposed a potential kink in my server's armor. So I went looking for an alternative. I've read about using lighttpd by proxying requests from Apache. Setting it up was straightforward and seemed to work well, until a customer complained that he couldn't purchase. I tried it myself (again) and it worked fine. I had someone else try again and it failed. Hmmm. After much tinkering, I figured out the problem, my store code required an https connection otherwise it redirected to https which was fine, except that coming from the proxy, it was always an http connection. Since I already do a redirect on my store so that any http://store.receiptwallet.com requests goes to https://store.receiptwallet.com, I can be assured that all requests are secure. So I commented that line out of my store and everything is working fine.
(On a side note, the reason I couldn't see it myself is that it was checking for local requests and since I access my server using a private IP address range, it basically got flagged as local, so it never required the SSL connection.)
-
Am I being told something?
I went to install a new hard drive in my server today to pre-emptively avoid a disaster as the drives in my server have been running 24/7 for 1.5 years and the drives are so cheap, that replacing it should save me time later. I thought all I had to do was power down, yank one drive, power up, partition the new drive, and rebuild the RAID. That is great in theory, but my RAID had errors so when I rebooted, it failed to reboot. I ran fsck on it (after failing to read what the screen told me to do for too long) and let it repair lots of little problems. After that, I was able to reboot and rebuild the RAID. In about an hour, my RAID will be rebuilt and I'll let it sit for a few days before I go ahead and replace the second drive. With all the problems I have with my server, you'd think I'd learn to just use a hosting service and let someone else manage the hardware. Oh well.
-
An adventure in shopping
Yesterday, my wife and I went shopping for some outdoor umbrellas. Not just any umbrellas, but ones that would extend over our pool (I went swimming on Saturday and my wife and son sat under one of our regular umbrellas on the side of the pool and we thought it would be a good idea to get some shade actually over the pool). We went to Home Expo and found nothing; next stop was Home Depot where we found 2 umbrellas, but no bases for them. Then came Costco, Lowes, and another Home Depot. Nothing. (We always tend to miss the right time in the season to buy.) We looked online and I found several, some with free shipping. Problem was if we didn't like them, returning them would be problematic due to the weight. I found the same umbrella we saw at Home Depot on their online site for the same price and free shipping. However, online purchases can't be returned at the stores. Hmmm. The listing has an in store SKU, so I started calling stores. The store we went to said they had 5 available and would visually check the stock. After being transferred around for a bit, I finally spoke to someone who was yelling to someone that had a clue. Turns out they had 2 without bases (I could have told them that). They didn't know where the other 3 or the bases were.) I'm not sure how you lose bases (there were 2 boxes per umbrella) that weight 114 pounds! I found another store (35 minutes away) that said they actually had 6 and set one aside for me (I asked for two). We drive up there (this was the first adventure with the little on in my car as his seat is on one side in my car and in the center in my wife's car, so we could fold down one seat) and managed to get 2 umbrellas in my car. Wow, those are heavy. After getting home and having a neighbor help me pull them out of the car, I put them together and am quite pleased.So, it's a good thing we got them at the "end of the season" otherwise I would have overlooked this model (it was 25% off). Too bad it was such a pain to get what I wanted. Such is life in the big city.
-
A week of server woes
Last week was another one of those weeks where my server decided not to cooperate. On Wednesday morning, I copied 7 GB of photos to my server so my wife could tag them and upload some of them (not 7 GB, of course) around 8:15 am. Every 2 hours, my server automatically backs up to a secondary hard drive. Apparently this process (using rsync) combined with other stuff going on (that's my current theory) caused my server to have a fit and crashed around 10:30 am. Then the process kept continuing as it kept trying to copy the files every 2 hours. Then at around 1 am, my server backs up everything to tar/gzipped files which caused it to crash again due to the load getting way too high combined with higher external temperatures. I finally figured out what was going on around 2:15 am when I was up with the little tike and got my server stablized by excluded the photos directory. Then on Friday when I was doing backups, there was some corruption on my backup drive which caused the CPU load to spike to 14 (normal is about 0.25 or less) and prevented me from unmounting the drive. A quick reboot got me up and running again. I reformatted the backup drive, did backups to it and everything has been running smoothly. During this whole fiasco, I increased the case fan speed to the max and brought the temperature down a bit.
Phew, everything is working again with very little downtime. I still refuse to co-locate my server somewhere as I like to have complete control over things and am extremely paranoid about backups (see my post on what I actually do.
Soon I should probably replace the main drives in my machine as they're over a year and a half old. While that may not sound old, they've been running 24/7 since I installed them. Since the drives are in a RAID 1 configuration, replacing them should just be a matter of shutting down, yanking one drive, putting in a new drive, formatting it, let the RAID rebuild and then repeating the process. Anything I can do to prevent another crisis is well worth it.