Archive for the 'Logjamming' Category

Beach Time!

July 10, 2008 1:33 pm by brian

Hey all. I’m heading to South Carolina till tuesday. Until then, Any development stuff I’ve been working on for you will be on hold. Pat and Welch will still be doing support and Josh and Chris will be on hand to assist. Just giving our wonderful customers a heads up!

Woo hoo! New version of Plesk

May 28, 2008 5:26 pm by brian

We recently upgraded the version of plesk. As such y’all should have a much swankier user interface and smoother ride in the control panel. Hot-digitty dog!

DDoS Attack

March 25, 2008 12:22 pm by brian

So, some of you may have noticed a slowdown in service the past few days. Thats because we’re fighting off a DDoS attack. It seems that shortly after posting a scathing anti-scientologist post, our friends over at Killoggs (http://www.killoggs.com) became the target of a distributed denial of service attack. It’s been going on for about 5 days now and we’re doing what we can to abate it. Got questions, contact support!

Sed vs Tail Showdown

February 28, 2008 1:36 pm by brian

Today I was presented with a problem. A colleague of mine did a MySQL dump on a database. The resulting MySQL dump file was 40GB. Problem is, he forgot to tell mysqldump to leave out the drop/create table statements. Here’s the rub:

What is the most efficient way to remove the first 43 lines of text from a 40GB text file?

“Surely there must be a simple *nix utility to do this.” we thought. My first guess was simple:

me: “Just use sed and tell it to delete the first 43 lines. Simple.”

colleague 1: “But won’t the regex engine be very inefficient for that?”

colleague 2: “Meh, I think sed is the right tool for the job.”

Now at this point we have a square off. Colleague 2 feels that the inclusion of the regex engine is simply too much overhead and is like bringing a bazooka to a knife fight. So they start to look around and I start doing some tests with a 1.5GB MySQL dump from Killoggs. Immediately, I see that it’s trying to create a temp file. If it’s creating a temp file, then that means it’s going to either create the temp file and rename it or create the temp file and copy it. Neither of those are especially good solutions because it will result in (at least) a lot of CPU utilization and even after the basic operation is done, there is still more to do in the way of a copy, move, etc.

So the next thought is doing the inverse. Rather than trying to delete the data, maybe we simply don’t want to output it. This logic seems to bear more fruit and the result is the following two potential solutions:

  • a) sed -n ’43,$p’ filename | mysql
  • b) tail -n +43 filename | mysql

Now, the real question? Which is faster? To test this i created a 200MB dummy text file comprised of log data. I then took this and ran the following commands repeatedly. The result? Both sed and tail were about the same as far as both real and system time. They both fluctuated and both came out roughly neck and neck. The real key was user time. Sed was always an order of magnitude slower as far as user time. In the end, this would lead me to concede my initial suggestion and go with tail.

Got thoughts on this? email me at brian …at… logjamming.com!

[bharrington@berstuk tmp]$ time `tail -n +41 test.log > /tmp/file1.test `

real 0m6.479s
user 0m0.077s
sys 0m1.145s
[bharrington@berstuk tmp]$ time `tail -n +41 test.log > /tmp/file1.test `

real 0m4.454s
user 0m0.061s
sys 0m1.091s
[bharrington@berstuk tmp]$ time `tail -n +41 test.log > /tmp/file1.test `

real 0m4.498s
user 0m0.049s
sys 0m1.058s
[bharrington@berstuk tmp]$ time `sed -n ’41,$p’ test.log > /tmp/file2.test `

real 0m5.025s
user 0m1.434s
sys 0m1.063s
[bharrington@berstuk tmp]$ time `sed -n ’41,$p’ test.log > /tmp/file2.test `

real 0m4.862s
user 0m1.351s
sys 0m1.091s
[bharrington@berstuk tmp]$ time `sed -n ’41,$p’ test.log > /tmp/file2.test `

real 0m4.606s
user 0m1.440s
sys 0m1.124s

Eclipse IDE

February 20, 2008 6:27 pm by brian

Eclipse is a pretty common development too familiar to Java developers. I’m starting to get into the swing of Java development and decided that I would give it a try. I’d tried installing it in the past and it was a bit of a bugbear. Recently, I noticed that it is available in the yum repository for Fedora. I like package repositories so I figured i’d give it a shot. What followed was a path filled with some ups and downs. To make things easier for you, I’m writing up a cheatsheet as to how to get it running as fast as possible with as little headache as possible.

First and foremost, you’ll want to install the following packages in Fedora with yum:

yum install eclipse-platform eclipse-emf-xsd-sdk eclipse-emf-sdo eclipse-ecj eclipse-emf-xsd eclipse-jdt eclipse-emf-sdo-sdk eclipse-rcp eclipse-emf eclipse-gef eclipse-subclipse eclipse-phpeclipse

That will do much of the heavy lifting and should get you going with doing PHP, Java, etc development.

Your next step (if you dare) will be to use Eclipse’s “update manager”. Now the update manager in eclipse is not nearly as friendly as yum, apt, etc. It does the work of telling you “yo, you’re missing XXX dependency” but not much else. You’re going to have to dig, and it’s not always friendly. Googling to find the package name (and sometimes package name + eclipse & “update manager”) will normally give you some pretty good links to add to the update manager.

To get you started, here’s a copy of my exported sites. You can easily import this by saving it as an XML file and then using the “import sites” utility in the update manager.

Eclipse Bookmarks

Good luck!

Outage yesterday

February 11, 2008 1:28 pm by brian

more to come later today once we finish reaming out our datacenter provider.

It’s time to party

December 31, 2007 1:25 pm by brian

Put on your dancing shoes and get ready to boogie. It’s new years eve! If anyone has any good new years or x-mas stories, flickr streams, or awesome recipes email them to party@logjamming.com. We’d love to share them!

Back from Nevada

December 26, 2007 9:34 pm by brian

I’m back. The other boys aren’t, but we’re still here for you. I’m going to be doing some server upgrades the next few evenings so if things get wonky, that may be why.

Merry X-Mas.

December 25, 2007 7:27 am by brian

Hope santy claws left fun things for y`all.

Santy Claws

In Nevada

December 22, 2007 3:30 pm by brian

We’re away all over the place right now on vacations. Josh in North Dakota, Pat’s on tour down to florida with Sick Fix, Chris is in New Jersey, and I’m in Nevada. We’re still doing support and all that jazz. Just wanted to keep everyone updated!