Mon, 11/21/2011 - 9:42am

The Backstory

The Drupal community has been on a profiling tear recently, largely driven by Mark Sonnabaum's evangelization of XHProf. We also have recently fallen in love with a number of different Symfony2 components, and the HttpRouter is now in Drupal 8. Given all the commotion I finally installed Symfony on my local this morning and wanted to share some thoughts about the future of profiling in Drupal.

The first thing I did after the install was look at the contents of the web/ folder. In addition to app.php, there was a file called app_dev.php. App.php behaves likes a normal index.php, routing requests and the like; app_dev.php has a little something extra.

Notice that persistent toolbar on the bottom of the screen? It shows number of database requests, whether or not a user is authenticated, and which controller handled the request.

Implementing With Drupal

The fact that this toolbar is shown on each page when the user is visiting app_dev.php is important. Demonstrating how a change to a query or a control structure leads to slow page loads is something which should be shown on each request. By making this data exposed it subsequently becomes actionable; developers can see in real time how changes to their code affects application performance.

On a practical level, the same type of access control could be implemented as that given to update.php. When $update_free_access = FALSE, the user must be authenticated. This change would be about as easy as adding $dev_page_free_access = FALSE to settings.php and writing a function to generate the toolbar. Index_dev.php (or whatever the page is named) would simply have the addition of that function.

Why Should I Give a Damn?

Profiling is something the Drupal community should start doing a LOT more as a whole. It helps ensure we produce software that is ready the heavy usage it experiences in the wild. This is particularly important as we start to develop an enterprise-focused piece of software. After all, maybe calling node_load() in a loop isn't such a good idea!

Sun, 10/30/2011 - 1:07am

I can't believe I've never done this before, but here it is!

$conf = array(
  'cache' => '0',
  'preprocess_css' => '0',
  'preprocess_js' => '0',
  'block_cache' => '0',
  'page_compression' => '0',
);
Pretty simple, huh?
Sat, 10/08/2011 - 8:22pm

I recently ran into an issue where I got the following error while trying to install Rubygems:

ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand
Here's how I fixed the issue:
rvm remove 1.9.2
rvm pkg install zlib
rvm install 1.9.2 --with-zlib-dir=$rvm_path/usr
And once again...gem's can be installed!
Sat, 09/24/2011 - 1:12pm

I am happy to announce that I am now a member of the Drupal.org infrastructure team. I will be working on a number of projects:

  • Moving from cfengine to Puppet for systems configuration management.
  • Securing password hashes using the PHPass module.
  • General day-to-day operations assistance.

I'm excited to get rolling!

Tue, 06/07/2011 - 10:31pm

I start at Acquia in a few weeks and I want to reflect on my time at Digital Rhino before I head to my new gig. I learned more than I ever imagined, met so many amazing people, and got to work with awesome clients. The most important lessons I'll be taking with me go far beyond the Drupal or even the programming space.

I will be working as an Engineering Intern at Acquia, splitting my time between automation work and projects for the Office of the CTO. I have a lot of sentiment that I will write about in coming weeks, but I would like to sincerely thank George and the rest of the Digital Rhino team for the incredible experience!

Thu, 04/28/2011 - 1:33pm

Custom CMS’s are amongst the most dangerous systems on the web.

PHP, Java, ASP.NET, and Ruby are each wonderful languages for their own reasons, but none of them are truly strong at managing large amounts of content out the of box. In fact, it is this lack of organization that make them so powerful when building products. Even so, for some reason we have become obsessed with building our own systems instead of accepting and extending those already in existence.

Drupal, WordPress, and even Joomla! will kick the hell out of any custom data management system an individual builds. The beauty of open source software is that the thousands (and even millions with WordPress) of people are able to contribute their own ideas into the community. I challenge anyone who has build a CMS that rivals Drupal, WordPress, or Joomla! to prove it’s as powerful and extensible.

© 2011 - Sam Kottler