Tuesday, April 7, 2009

New Zend Application Server released today

It was an exciting day here at Zend today, we officially released Zend Server into GA, and I have to say this is an important milestone for the industry. It reminds me of the time 12 yrs ago when I was working on another new server technology at Netscape the very first Java Application Server that started a whole new category of software and opportunities on the web. Well NSCP's app server was technically not the first version as NSCP merged with the first one built by Kivasoft and release the next version under the new NSCP name. But it was that next version that made a huge impact on the internet and the name change was one of those things that signaled a maturing of the corprate market that was ready to adopt application servers as solutions. Websites needed better Scalability, High Performance and productivity improvements over the old way of doing things on the internet back then.

NSCP App Server was the beginning of the shift away from client/server corporate initiatives and desktop apps development like powerbuilder and visual studio onto the web. As of today only 33% of these internal employee applications have moved in 12yrs to the web, and that's mostly because of the lower productivity and high startup costs of early app server solutions. Scripting languages like PHP improve things at the language layer, but a complete solution is needed to addresses best practices and gain even more productivity while developing your next web ideas. As Yogi said once "This is like deja vu all over again"

Now fast forward to today's release of Zend Server, it offers PHP websites enterprise capabilities without the complexity and overhead of those first generation Java App Servers. Sure it can help with High Performance, it has the fastest PHP Byte Code accelerator technology out there. No other PHP caching technology is faster either, not even APC, and if you are running PHP applications on Windows then there is no other technology that is more reliable and tested for production environments under stress then Zend Server. We've implemented an APC function mapping layer into Zend Server that will allow your PHP apps using APC calls to utilize the faster internals of Zend Server without need to change your app code. So examples like phpBB modified to use it will run on Zend Server without code changes, and run even faster but with additional capabilities that will surprise you. Like better troubleshooting.

Quickly pinpointing the root cause of a problem and the tools to reproduce them faster is a major feature developers are surprised about when they start to use Zend Server. Like a sports car that you test drive because it performs well on the road, you the driver soon fall in love with the internals. As you sit behind that wheel you'll really get a good feel of the Zend engine and quick acceleration, but also fall in love with all the other things that makes driving it special. So take the new Zend Server out for a spin, you will also find many surprises that will WOW you even more then the thrill for speed as you sit behind the wheel. I'll be blogging more about those in the next few weeks, but since we are on the topic of speed. I had a meeting with one of our closest customers today, and used Zend Page caching to make a new PHP app more then 70 times faster, took only a few min after installing the server. I'll show you how to do the same thing in opensource using Joomla and Drupal in my upcoming article.

Thursday, April 2, 2009

Zend Framework can save your weekends?

And maybe even your marriage. I wrote this on Apr 2nd so that its not mistaken for an April fools joke, but a customer of ours wrote a very interesting article about the benefits he sees from using Zend Framework. He listed many great benefits of ZF standardization at Panasonic, but one of the more interesting ones was a business value that I have not seen blogged about much.
Jim Plush wrote: Upsides to this for (my) developers is the fact you're getting trained on the most popular php framework out there and no longer will you have to spend your weekends learning someone (else's) code who just quite.

This indeed is a major problem faced by many managers who have to support not just PHP, but other legacy environments both old PHP ones and other apps like the one Jim writes about in his blog when the team changes over time. As managers we know that successful apps will live on for many many years so a good strategy of how to reduce support costs over time was an important factor for Jim, so his solution was to simplify and standardize on best practices with the zend framework moving forward. As he put it so well in his own words.

We're dedicating all in house development to Zend Framework. If it's a web app it's either built in our Zend Framework infrastructure or it doesn't get built (in Panasonic.)


This final statement was something I have been hearing a lot from development managers who are optimizing the productivity of their web development efforts using PHP. I hope to share this same scenario from one of the largest Fortune 500 firms in an upcoming article. Today I learned that they also are writing about their own results using Zend so I wont spoil the presentation. Stay tuned. But if you want to learn more about why Jim at Panasonic chose Zend Framework and PHP for his Enterprise, read on.

It looks like he's also looking for a few more good people to add to his Zend Framework team, read job post here - the March job numbers are expected to be horrible, but folks with Zend skills are doing very well indeed this year.

Wednesday, April 1, 2009

Taking Zend Server for a Spin (part 1)

April in my neck of the woods is when the weather starts to get nice and Spring is in full bloom, its also the time my wife and I take our classic car out for a spin. Its fun to drive with the top down to shake off winter blues and drive somewhere new. Well I've been doing a lot of that at work too testing the new Zend Server and seeing what's under the hood (not just the Zend Engine 2, but all the other things that make the new server go).

If you've missed all the news and announcements about Zend Server, take a look at Andi's blog, it has some real good posts and an insiders look at the Windows and Linux versions.

In my blog this week I'd like to take Zend Server for a spin, if you want to follow along you will need to install it first, and then activate all features by installing a trial license, your first screen should look all green on the right side like the figure above. If not, you may not have licensed your trial copy, click here for instructions, or if you originally decided not to active some features, its easy to reactivate.

Next let's setup some PHP apps to work with, setting up the preinstalled Zend Framework demos are easy to do. If IIS is your web server I recommend using IIS7 that supports the apache rewrite rules module and just copy the demo zend framework directory into the www root.

If youre using apache web server you can also copy the "demo" directory from the Zend Framework install, to your htdocs web root. To find out where the demo's are located, you can do a browser page search in the following PHPINFO screen, it can be found in ZendServer Admin menu Monitor>PHP Info and then do a search in the page for the word ZendFramework. That will list out the entire path downto the library subdirectory, just go up one level and you will see the demo folder.

If you copyed it in the right place it should all work now, your first Zend Framework demo should display now in the browser, http://localhost/Demo/Gdata/YouTubeVideoBrowser and it should look like this screen (BTW you can click on any screen shot to zoom in and get a bigger view of it):

This Youtube demo is using the Zend Framework GDATA modules, there are many other examples that interface into Google apps like calendar, spreadsheet, photos, health, books, docs, and blogger. For full details of the ZF API for Google apps and all source is provided on how to do it in PHP. This would be a great way to build some of those web apps that I wrote about from Genentech last week.

There are quite a few web services examples, to run the Amazon book example type the following,
http://localhost/Demo/WebServices/Amazon/amazon-search.php there is also a UPC lookup example http://localhost/Demo/WebServices/Protocols/xmlrpc-upc-lookup.php

If you try to run the flickr demo you will probably only see a white screen in the browser come up.
http://localhost/Demo/WebServices/Flickr/flickr-search.php Is there something wrong with the demo or code bug? To help figure this out, let's go back to our Zend Server monitor screen and look at the latest error at the top of the screen, I highlighted it in grey here.Click on this first event to get even more details about the problem we are having. Click the ERROR DATA tab in the middle of the screen and we can see exactly why the problem is happening, its an INVALID API KEY.
So let us click Show File in Zend Server if you have that up and running and enter a valid key in the file flickr-search.php, you should register for your own key, its free at flickr and can be found here. There are a lot of problems scenarios like this that come up in real production and testing environments, that makes Zend Server ideal to track down quickly. Many times just looking at all the data collected is enough to figure out the problem like in this case, other times the applicaiton and problem is more complex and we would need to troubleshoot it with the Zend remote debugger or profiler. I'll have some more examples that will show how this is used, but for now let us just edit the file in Zend Studio and enter the API key in the code.

And save it, to test it goto http://localhost/Demo/WebServices/Flickr/flickr-search.php and if your key is valid you'll get a screen full of pictures instead of a blank window as before.
Next let us look at a feed demo, its a typical thing you would find in any content management system or PHP portal like Joomla, Drupal, or Dekiwiki. http://localhost/Demo/Zend/Feeds/consume-feed.php If you go back to Zend Server you will notice a new event at the top "SEVERE SLOW REQUEST EXECUTION", that's a bottleneck identified by Zend Server. On my laptop it sometime takes more then 2sec to execute this feed, I should know because on my firefox I have also installed a plugin to show me the rendering time of a page (FF plugin is called LORI)

There's another useful utility called the Zend Controller preinstalled in the bin subdirectory of ZendServer that can help us measure performance. Let's paste the feed URL into the utility and run a quick test to see how many requests per sec it can handle. Looks like only 1.1 requests/sec on my laptop, see figure below:

Now lets use Zend Server's page level caching to improve the performance of this feed as you can imagine this is a common problem in many portals and wiki's. I go back to Zend Server Admin, menu>Rules Management>Caching and will add a new caching rule.

I called my rule "FASTFEED" I filled in the URL to cache the output "http://localhost/Demo/Zend/Feeds/consume-feed.php" and then set the rule to cache the output for 360 sec and saved my script. Be sure to RESTART PHP after saving rule for it to take effect. Now I re-run my performance benchmark in Zend Controller, here's a screen shot of both the feed and performance test:



Notice in the Zend Controller I now have 3.75 times more requests per sec, and in Firefox the page speed went from 2-0.9/sec to 0.24/sec a dramatic speed improvement. Since this is a RSS feed, the timings vary wildly at different times during the day but this example is representative of realworld situations. Also note the Zend Controller measures first byte returned so tools like Apache Benchmark, JMETER and LOADRUNNER are good tools for further benchmarking.

So download Zend Server and take it for a spin, if you also use open source projects like SugarCRM for example, many will detect the installation of Zend Server and its data caching and will perform significantly faster automatically. In an upcoming article, I'll take some of those for a spin too and list out all the ones that I have tested. For more news on Zend Server release, click here.

The band I've been listening to the most while taking things for a spin this month is
Kings of Leon