HipHop PHP and Drupal

So, Facebook has released HipHop PHP - a PHP-to-C++ converter. While the name is stupid, the idea is not. 100% of their developers know PHP, I would guess that less than 5% of them are proficient at C++. So, HipHop takes their PHP code, and converts it to compiled C++ -- in turn, they get a huge boost in performance and get to keep their existing developers. HipHop is also it's own webserver too - fun!

My first thought was: I wonder what this could mean for Drupal? Well, David Struass, a maintainer of Pressflow (a set of patches for Drupal performance and scalability) put up a blog post about what it would take for Pressflow and Drupal to become HipHop-friendly. Exciting times!

3.666665
Your rating: None Average: 3.7 (3 votes)

Apache mod_proxy '[error] (13)Permission denied' error on RHEL

Had an interesting issue today working on a mod_proxy setup of Apache forwarding requests in a reverse proxy setup to a backend Tomcat server. No matter what I did, I kept getting this in Apache's error log:

[error] (13)Permission denied: proxy: AJP: attempt to connect to 10.x.x.x:7009 (virtualhost.virtualdomain.com) failed
5
Your rating: None Average: 5 (1 vote)

Teaching Java How to Commit Suicide

At $work, we have a lot of java processes that are ran via cron and other wrappers that do some pretty critical tasks. The apps have been written so that the whole thing is wrapped in a try/catch that will call system.exit(1) should something not go right. Our wrapper scripts watch for a non-zero exit code, and alert Nagios if something went wrong.

This works great except for when a VM encounters an outOfMemory exception (OOM). The Java VM attempts to continue on, but if the main thread hits this exception, the entire VM will exit. However, the application code that exits with a status of 1 never gets called, so the application ends up dying with a status of 0. Well, Sun (Oracle now I guess) gave us a new option in Java 6 that was backported to 1.4.2_12 and up that allows us to tell Java to run a shell command when it encounters an OOM exception. By adding the option

-XX:OnOutOfMemoryError="kill -9 %p"

to our Java command line, the VM will execute a shell that calls the kill command, with an argument of the PID of the VM. The -9 option to kill will cause the VM to exit with a non-zero status, so that our wrappers will pick up the error and alert the right people.

Note: this feature was never backported to Java5 - sorry!

0
Your rating: None

Display a CCK Filefield or Imagefield Upload Widget on Your Own Custom Form

Took a fair amount of googling around to find the solution to this one. With the Node Gallery 3.x branch, we needed a way to quickly add an image to an existing gallery. We could have displayed the whole node form, but there's a lot of things on that form that we can just use the defaults for 99% of the time. We need just three fields filled in: Title, Caption, and the imagefield itself.

4.4
Your rating: None Average: 4.4 (5 votes)

Drupal, meet Hudson; Hudson, Drupal...

At $work, we use Hudson extensively, and it rocks. For those who don't know already, Hudson is an implementation of Continuous Integration that is remarkably easy to use. I wrote about my first impressions of Hudson previously. Hudson's original audience was Java developers using Ant or Maven, but with plugins and some hacking, we can make it do some things for us as module contributors to Drupal.

4
Your rating: None Average: 4 (8 votes)

ZFS in the Trenches presentation at LISA 09

Just got the chance to finally sit down and watch Ben Rockwood's presentation at LISA 09: ZFS in the Trenches. If you are even thinking about ZFS and how it works, it's a very informative presentation. There is very little marketing-speak, and he very specifically targets sysadmins as his audience. Great stuff! Of interesting note about his comparison of fsstat vs iostat, our Apache webservers routinely see about 5MB/sec reads being asked of ZFS, but the actual iostat on the disk shows that almost all of that traffic is being served up from ARC.

0
Your rating: None

QuickTip: Fix Eclipse Galileo buttons on Ubuntu 9.10

There's a nasty upstream bug in GTK present in Ubuntu 9.10 that makes Eclipse Galileo all but unusable -- specifically it makes clicking many buttons with the mouse just stop working. You can use tab and spacebar to make it work, but that's not much of a workaround. All you need to do is set an environment variable before starting Eclipse:

export GDK_NATIVE_WINDOWS=true
5
Your rating: None Average: 5 (3 votes)

Share Your Eclipse Plugins and Configurations Across Platforms

Over the years, I've come to know and love Eclipse.  Though it has roots in Java, ironically, I use Eclipse for just about everything except for coding Java (if I wrote Java code, I'm sure I'd use Eclipse).  Eclipse is great for browsing Subversion, coding PHP, coding Perl, and even coding shell scripts.  For die hards like me, there's the viPlugin that allows you to use all the vi commands you know and love within Eclipse.  About the time you get your perfect Eclipse setup established, you buy a new laptop on a new platform.  Or, in my case, I have three "primary" development workstations, each on a different OS.  The rest of this article will show you how to hook Dropbox into your Eclipse installation, allowing you to share your plugins and configurations across different versions of Eclipse, on different machines, and even on different platforms.

0
Your rating: None

NGINX Performs Well on Solaris 10 x86

Just a quick posting of some simple benchmarks today.  Please note, these are not the be all, end all performance results that allow everyone to scream from atop yonder hill that Solaris performs better than Linux!  This was just me doing a little due dilligence.  I like Solaris 10, and wanted to run it on our webservers.  We're looking at using NGINX to serve up some static files, and I wanted to make sure it performed like it should on Solaris 10 before deploying it - you know, right tool for the job and all.  So, disclaimers aside, here's what I found.

0
Your rating: None

Ask SAJ: What to do with Apache logs > 50GB?

Our site at $work is generating Apache logs that, when combined sequentially into one file, are larger than 50GB in size for one day's worth of traffic. AWStats' perl script pretty much chokes when working on this much data. Last I checked, Webalizer wasn't much different, and probably wouldn't scale up to that amount of data either. Does anyone out there have any advice on a commercial solution for Apache log analysis that can scale up like that?

0
Your rating: None
Syndicate content