iPhone Server Alerting on High Load
Friday, January 15. 2010
I have a shared Dreamhost account. In fact, I manage two: my own, and work's. Typically I don't too much care about my personal site going up or down, but I have multiple sites running under my account - and our work account with Dreamhost must maintain a decent responsiveness during business hours.
I've been developing a CakePHP plugin for Prowl but haven't quite polished it well enough for release. In the meantime, my work's Dreamhost account has had major issues where the server load would spike up to 350+ (I have no idea how many cores there are). That's just ludicrous. We've recently been moved to a new server by the support staff (for the 5th time) and although the average server load is now 0.40, I don't want to take my chances without a backup plan. Enter Prowl and my iPod Touch.
(To use Prowl, you would need an iPod touch or iPhone, and paid for and installed the Prowl application; it's $4.99 as of this writing. You then need to get your API from the prowl.preks.net website.)
We'll be using the PHP 3rd party API for Prowl, built by "Fenric", and we will go to his GitHub account to get it.
Once we have the PHP API for Prowl from Fenric, we'll build some quick code to make use of it:
This little script can easily be setup with a cronjob and automatically check the current server's load and report issues. It won't report if a server is down since it must run on the server it is reporting on, but it would help inform about possible problems that should be looked at. This could easily be extended to check the MySQL long query logs, or other reporting functions.
I've been developing a CakePHP plugin for Prowl but haven't quite polished it well enough for release. In the meantime, my work's Dreamhost account has had major issues where the server load would spike up to 350+ (I have no idea how many cores there are). That's just ludicrous. We've recently been moved to a new server by the support staff (for the 5th time) and although the average server load is now 0.40, I don't want to take my chances without a backup plan. Enter Prowl and my iPod Touch.
(To use Prowl, you would need an iPod touch or iPhone, and paid for and installed the Prowl application; it's $4.99 as of this writing. You then need to get your API from the prowl.preks.net website.)
We'll be using the PHP 3rd party API for Prowl, built by "Fenric", and we will go to his GitHub account to get it.
Once we have the PHP API for Prowl from Fenric, we'll build some quick code to make use of it:
This little script can easily be setup with a cronjob and automatically check the current server's load and report issues. It won't report if a server is down since it must run on the server it is reporting on, but it would help inform about possible problems that should be looked at. This could easily be extended to check the MySQL long query logs, or other reporting functions.
Prowl, an iPhone/iPod Touch implementation of Growl
Friday, January 8. 2010
So, I hear you like the idea of push notifications on the iPhone. Oh, what's that? You wish you could send push notifications from your website and/or iPhone enabled web app? Hey, didn't you know that you can?
Thanks to Mike, and his post about what John Blyberg's been doing, I got interested in Prowl. Prowl is an iPhone app ($4.99 from the iTunes store, I believe) that lets us send push notifications to iPhone or iPod Touch devices (and hey, it works with 1st gen devices too!). You would need version 3.1 of the iPhone OS, and jailbroken phones are not officially supported (some work, some don't due to how they were jailbroken), but for the most part "it just works", and it's fast. From my tests, the longest delay I've had thus far on a "normal" importance level Prowl message was about 2-3 seconds.
So what use does it have? I'm sure there could be quite a lot. There are forums for Prowl discussions, and one of the stickied topics is just about what people are doing with custom notifications, and there are a varied slew of responses. It's quite interesting, actually.
It's not much of a surprise to anyone that's been keeping tabs on this blog (hi Mike) that I have been getting acquainted with the CakePHP framework. Because of all the uses of Prowl, and my newfound love for CakePHP, I've decided to write a plugin specifically for Prowl in CakePHP. I am not the first to create extensions for Prowl by any means, nor am I even the first to think of getting it CakePHP-ready. I've found two others after having started my work that have created Prowl Components: Jacob Oehler Morrison, and Eric Holmes (note: as of this writing, Eric Holmes' domain seems to be expired). Hopefully I can add a little bit more zest and out-of-the-box capabilities to a plugin. If anyone has some ideas, let me know about it in the comments!
Thanks to Mike, and his post about what John Blyberg's been doing, I got interested in Prowl. Prowl is an iPhone app ($4.99 from the iTunes store, I believe) that lets us send push notifications to iPhone or iPod Touch devices (and hey, it works with 1st gen devices too!). You would need version 3.1 of the iPhone OS, and jailbroken phones are not officially supported (some work, some don't due to how they were jailbroken), but for the most part "it just works", and it's fast. From my tests, the longest delay I've had thus far on a "normal" importance level Prowl message was about 2-3 seconds.
So what use does it have? I'm sure there could be quite a lot. There are forums for Prowl discussions, and one of the stickied topics is just about what people are doing with custom notifications, and there are a varied slew of responses. It's quite interesting, actually.
It's not much of a surprise to anyone that's been keeping tabs on this blog (hi Mike) that I have been getting acquainted with the CakePHP framework. Because of all the uses of Prowl, and my newfound love for CakePHP, I've decided to write a plugin specifically for Prowl in CakePHP. I am not the first to create extensions for Prowl by any means, nor am I even the first to think of getting it CakePHP-ready. I've found two others after having started my work that have created Prowl Components: Jacob Oehler Morrison, and Eric Holmes (note: as of this writing, Eric Holmes' domain seems to be expired). Hopefully I can add a little bit more zest and out-of-the-box capabilities to a plugin. If anyone has some ideas, let me know about it in the comments!
