* How Do You Spell Relief? M-O-S-H-E!
Posted on May 21st, 2008 by Phil. Filed under Devel, Drupal, FeedAPI, PHP, Pathauto, Television, Token.
As you regular readers know, we’ve been struggling with a little memory problem here as of late. Basically, under several different circumstances, PHP would quit and tell us it had used up all of its allocated memory, which we had jacked all the way up to 512MB.
At first, I suspected it was due to some server configuration issues, since we had just built an entirely new environment from the ground up. After a while we figured out it was definitely a code issue, and possibly more than one. After examining our own code, poking around contributed module code and some trial and error, I hadn’t been able to pinpoint the problem. Things were starting to look … worrisome.
But, as they say, it’s always darkest before the dawn for the other day what to my wondering eyes should appear but a comment on this blog from Moshe Weitzman. Moshe is one of the original Drupal developers and remains one the key core and contributed module maintainers to this day. Apparently, he is also a local resident and WGBH fan.
He’s also a very nice guy.
Moshe had discovered this blog and offered up his considerable help. Right away he fixed a memory leak in the Devel module and released a new version, which solved our problem of sometimes running out of memory when invoking the theme editor.
But he wasn’t done helping us with just that tidbit. Oh me oh my no.
I gave him a rundown on our problem of running out of memory when doing our nightly TV schedule data import and he was able top quickly suggest some possible culprits. Sure enough, after some tinkering around, I found that the problem went away when I disabled the Pathauto and Token modules. I tinkered with the FeedAPI cron function to disable these modules at the start and reenable them at the end of the process. As a result, memory usage during the import of our schedule data dropped by ten-fold.
Whew!
This fix, however, did introduce one new wrinkle: we used the Pathauto module to set URL aliases for new TV program and episode nodes that are created during the nightly import. By disabling Pathauto, I then had to write my own bit of code to set these aliases during import. Not a huge deal and, really, quite a small price to pay.
The bottom line of all this is that I am now sleeping just a little bit better each night and we’ve been able to ratchet down the maximum amount of memory assigned to PHP from 512MB to 128MB.
Thanks again, Moshe!
4 Responses to “How Do You Spell Relief? M-O-S-H-E!”
Leave a Reply
You must be logged in to post a comment.
Archives:
- February 2009
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
Categories:
- Apache
- Architecture
- Boost
- caching
- CCK
- CMS
- cron
- CVS
- database
- Date
- Devel
- Drupal
- Drupalcon
- FeedAPI
- Flickr
- Image Assist
- Images
- Install Profiles
- MacBook
- Memcache
- MySQL
- NPR
- Pathauto
- PBS
- PHP
- Preview
- Protrack
- Public Media
- search
- Social Media
- SQL
- SVN
- tags
- Television
- Testing
- theme
- TinyMCE
- Token
- Tools
- TV Guide
- Uncategorized
- Views
- WordPress
Disclaimer
- The opinions expressed in here are those of the writers/contributors and do not necessarily represent the views or opinions of the WGBH Educational Foundation.











May 21st, 2008 at 2:40 pm
Totally cool stuff! If I had known one of the Drupal developers was a ‘GBH fan I would’ve tried to let him know about the Lab when I first got here (the WGBH Lab site is built entirely on Drupal). Not that there’s anything wrong with our site, just more of a “hey, thanks for giving us such a cool CMS.”
Hooray for effective, interesting, and useful internet communication!
May 21st, 2008 at 2:54 pm
Hi Bryan! Thanks for pointing this out. Good seeing you in LA. Hope our paths meet again soon.
Hi Phil! Interesting that you’re able to enlist such assistance. Good to hear that you’ve zeroed in on the solution to your problem.
Thought you both might find this interesting:
http://pubforge.org/blogs/pfblog/2008/05/radio-engage-collaboration-elists.html
All the best, John Tynan (from http://kjzz.org )
May 21st, 2008 at 7:40 pm
Thanks Brian and John! I’m glad you guys are reading and enjoying the blog…!
The PubForge blog looks interesting. I’ve added a link to it on the right. Thanks for pointing that out.
August 9th, 2008 at 12:10 pm
Honi soit legate left buy cytotec then announced held.