tekrat

Apache Stat Cache

  • Filed under: tech
Monday
Dec 22,2008

I’ve made available an experimental patch I was working on for Apache to cache file stat calls.  Unfortunately it’s not very useful, but I’m posting it online in it peaks someone’s interest or perhaps finds another use.

One great thing to optimize out of any system is system calls, and especially any system call that access i/o or disk.  In an attempt to exclude all stat calls from the Apache/PHP/APC stack, I created an Apache file stat cache that would cache all the stat calls in memory and never repeat a stat call….   As it turns out this patch isn’t really that useful, as the gains are pretty marginal if at all, and typically you’ll have heavier performance bottlenecks in PHP code than the one stat call that Apache is going to do per request…  (full page here)

  • 0 Comments
  • Updated Apache Source Defense patch.

    • Filed under: tech
    Wednesday
    Dec 17,2008

    I’ve updated the Apache Source Defense patch to correctly match extensions.  Prior to these changes any file that contained a ‘.php’ extension would be included, such as .php.txt etc.  I’ve now corrected this so it will only match the last extension in a file.   If  you are currently using this and expect it to protect against these situations, please add additional extensions to the patch to make sure you’re protected (I hold no liability for this not working as advertised).   If you run across any problem, bugs, missing features please let me know.

  • 0 Comments
  • Xdebug Connectback patch updates

    • Filed under: tech
    Wednesday
    Nov 26,2008

    I’ve added some updates to the XDebug connect back patch.  This now includes a fix for JIT with the latest version of XDebug from Lucas.  I’ve also added a fix for a segfault when running from the commandline or when REMOTE_ADDR isn’t available.

  • 0 Comments
  • Using ‘make test’ with PHP extensions

    • Filed under: tech
    Tuesday
    Nov 11,2008

    It’s often the case that I want to run a ‘make test’ on some PHP extension I’m installing as a dynamic .so file.  This often fails, as the PHP INI configuration is still read from the normal places except that the .so path is changed to match that of the extension I’m working on.  This means that there are possibly a lot of unecessary errors regarding PHP’s inability to load missing extensions or trying to load the same extension twice.  The work around for this is really simple, but probably not obvious.  I discovered this a while back in an email thread to internals (thanks Marcus), but recently forgot about it until a co-worker brought up the issue for me again.  If you do run into this your best solution is going to be setting the environment variable TEST_PHP_ARGS=-n.  ie:  ‘env TEST_PHP_ARGS=-n make test‘.

  • 1 Comment
  • Updated FatMM patches

    • Filed under: tech
    Monday
    Nov 10,2008

    Thanks to some feedback from Luke Weber I’ve now *correctly* updated the PHP FatMM patches so they’ll actually compile ;-).   It sounds like this saved him about 6%, which is less than I expected but nothing to be ashamed of either.  Interested to hear other peoples experiences with this if they’re brave enough to try it out!

  • 0 Comments
  • Saturday
    Sep 27,2008

    The Zend Fat MM patches have been updated to support setting an environment variable, ZEND_FATMM, to control the size of the pre-allocated memory size. The memory size setting can now also be set to 0 to effectively disable the Fat Memory Manager. I also wanted to be able to control these settings from the Apache configuration directive SetEnv in the env module. This, however, won’t work under PHP in it’s current form as SetEnv doesn’t actually set the system environment variables. To work around this I’ve also created a new directive, SetSysEnv, which enables users to control actual environment variables from within Apache configurations. This is useful for setting things like ZEND_FATMM, as well as the other environment variables in the Zend memory manager. Enjoy and drop me some feedback.

  • 3 Comments
  • Kabuki Reserved Seats

    Wednesday
    Sep 3,2008

    I finally got to go to Kabuki theatre since they’ve remodeled specifically for the purpose of trying out their reserved seating.  The theatre looks fantastic, and the staff is great too.  They have automated ticket machines where you can reserve your seat, or you can reserve them online before you go to the theatre.  There’s a nice bar upstairs, a coffee bar, and seating to lounge around in until the appointed time of your movie arrives.

    I didn’t try the bar this time, (gotta save something for next time), but I think it’s definitely worth the drive to go to a theatre like this.  There’s a sur-charge for the assigned seating in addition to standard movie prices, but I’m tired of paying high prices to wait in lines and fight for seats, aren’t you?

  • 0 Comments
  • “The Omnivore’s Dilemma”

    • Filed under: reading
    Wednesday
    Aug 27,2008

    On the recommendation of Terry I recently finished reading The Omnivore’s Dilemma.  I thought it was a wonderful read, part way through the first chapter I realized that I had just read about corn for the last hour or so and was completely enthralled.  It takes some skill to take something as mundane as the history and evolution of corn and make it into an enthralling experience.  Beware, however, that this book will likely change the way you think about you meal not necessarily in the typical to eat meat or not to eat meat.  This books goes much further than that, and regardless of you’re dietary beliefs, this book will appeal to everyone’s sense of taste.  I found the logic very realistic in it’s expectations and at the same time critical of every detail that goes into the creation of a meal.  I highly recommend this for anyone who cares about what they put in there body.

  • 0 Comments
  • Back and Forth

    Wednesday
    Aug 20,2008

    The doors on the muni wouldn’t open today, so we where all trapped inside.  Whenever something like this happens there always has to be one person that just doesn’t understand and will continually shout: “I need to get off, I need to get off, open the doors, open the doors….”, even though it’s quite clear this isn’t going to happen right away and everyone is well aware of this very obvious situation.  Note to self: if there’s ever a *real* disaster, make sure you kill off these people first as they’ll just end up getting sane people hurt.

    Once the doors opened I opted to wait out the muni fallout due to backed up trains, and went to Reverie for a cup of tea.  Here I found the plethera of wifi spots that is san francisco, my two favorites:

    The first is a movie reference, I’ve included the youtube clip to give it the right context.

    and this one just makes you want to waste all day trying to hack in:

  • 0 Comments
  • vim-scmdiff project on github!

    • Filed under: tech
    Friday
    Aug 15,2008

    A previous post of mine regarding setting up git diffs in vim got some traction so now an official repository for the derived code has been setup by Greg on GitHub.  This should provide a central home for various people to make contributions etc.
    http://github.com/ghewgill/vim-scmdiff/

    Make changes via the GitHub interfaces (fork/pull etc), or email us bugs/patches etc!

    Here’s a latest screenshot of it’s new incarnation:

  • 0 Comments