Today is a good day to code

Installing ColdFusion MX 7, and the Apache Connector on Leopard Server (10.5.5)

Posted: December 31st, 2008 | Author: | Filed under: Apple, ColdFusion, Companies, java, Programming, Uncategorized | Tags: , , , , , , , | No Comments »

Installing ColdFusion MX 7, and the Apache Connector on Leopard Server (10.5.5)

Picture of IrvinThis weekend, I spent an unpleasant 24 hours or so working on upgrading a client’s server to Leopard 10.5.5. The actual Leopard upgrade went pretty well on the G5 XServe. The secret to that was having a crossover cable, and knowing the specific RackMac system identifier to be able to get the IP address to SSH into. The problems started with ColdFusion.

Now I am going to rant. My client has an Enterprise license, so we aren’t running on some hacked up installation, we are running a major OS that has been on the market for about a year, it has been in the hands of developers for more than a year. That there isn’t a proper connector bundled with the installation is criminal. If I wanted to go hacking around inside of source code, building crap, I could run open source. Why did we pay so much money for this? I will not write any more private applications with ColdFusion. If a corporation wants me to build ColdFusion applications, I may, but only after I try to convince them to go with something that is more likely to be supported on UNIX / Mac OS X.

I mean, how long has Apache 2 64-bit been out there, this shouldn’t come as a surprise to Adobe. I can’t trust that they will support major platforms going into the future. This is because of one or both of two things. The first possibility is that Adobe doesn’t want to put money into ColdFusion because it is dead or dying, the second is that Adobe wants to force people to upgrade to ColdFusion 8 by any means necessary. What Adobe has done is to make me look bad in front of my clients for choosing a technology that was not supported. I have already begun to write my applications in RoR, now I am definitely going to write my applications in RoR. I am done. I could have made so much more money writing code instead of screwing around with compiler flags.

The problem is that I would expect to run into trouble installing or running my software when using OSS. That comes with the territory, but when you buy software and it claims to support the platform, one would reasonably assume that the platform would be fully and actively supported. Anyway, rant over.

Now I will show how I fixed the problem:

First:

If you have a standalone installation (the only one that works), you will need to start it by switching to your ColdFusion directory, if you followed the defaults, it will be /Applications/ColdFusionMX7/runtime/bin. You will need to issue the JRun command from here ./jrun -start coldfusion. This will work, if you try to start it any other way, you will get the THIS_PROCESS_HAS_FORKED errors.

If you have installed it in multi-server, you are screwed, I have not found any decent way to get this to work.

Second:

You should be able to get to the administrator on http://127.0.0.1:8500/CFIDE/Administrator/index.cfm. Then you will need to set up the connector, this was crazy. The solution I am about to post I found on Scott Pinkston’s blog. The post is called ColdFusion 8 Leopard with apache an answer for the rest of us. It is generally for CF 8, but it will work on ColdFusion MX 7.

Here are the steps from his blog:

go to terminal window.
cd /Applications/JRun4/lib
unzip -d src wsconfig.jar
cd src/connectors/src  

apxs -c -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 -n jrun22
mod_jrun22.c jrun_maptable_impl.c jrun_property.c jrun_session.c
platform.c jrun_mutex.c jrun_proxy.c jrun_utils.c

apxs -i -n jrun22 -S LIBEXECDIR=/Applications/JRun4/lib/src/connectors/src/
mod_jrun22.la

strip mod_jrun22.so

Now run the connector configuration:
sudo java -jar /Applications/JRun4/lib/wsconfig.jar

After it finishes, run this command:
cp /Applications/JRun4/lib/src/connectors/src/mod_jrun22.so /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so

sudo apachectl restart

The order of the files to be compiled is *IMPORTANT* I was working on a Dual-G5 2.3 GHz so my command was /usr/sbin/apxs -c -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64 -n jrun22 mod_jrun22.c jrun_maptable_impl.c jrun_property.c jrun_session.c platform.c jrun_mutex.c jrun_proxy.c jrun_utils.c.

You will get some warnings, you can ignore them. If you get an error saying something about functions that start with an underscore in your apache error logs, when you try to start it, you have the file names in the wrong order. If you see an error that says it found the module, and it is mach-o, but it is the wrong architecture, you are probably using -WI (I as in imitate) instead of Wl (l as in Larry).

Step 3:

Make sure to add the add handler to your httpd.conf. in the ifmodule for mod_jrun22.so. Mine did not install this by default, so my ColdFusion templates were coming up with the code showing up as plain text. Here is the default handler: AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf.

I hope this prevents anyone from going through the ridiculous configuration nightmare that I went through this weekend. I apologize for the rant, but I have some other cool projects that I would rather work on than spending forever hacking around with my application server.


The Future of Scripting

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Companies, Microsoft, Programming, Sun Microsystems, Uncategorized | Tags: , , , | 1 Comment »

The Future of Scripting

Picture of Irv Owens Web DeveloperInitially I wanted to stay away from scripting languages as a developer due to the fact that they weren't really programming languages at all. For some time I was reluctant to even call myself a programmer until I built my first Java desktop application. In CNET's open source blog today, they ask the question has scripting peaked?

Scripting hasn't peaked out yet. The reason is clear. Building a web site with C++ or Java is like driving an armored tank to your mailbox. It is that ridiculous. The funny thing is that even Microsoft realizes this, giving their ASP.net developers two languages to choose from when developing web applications. There are many reasons for enterprises to choose C# over Visual Basic when building a web application, especially if they already have desktop and client-server applications built using the technology. It would be possible to completely reuse many of the methods used in the desktop application for the web application. The frameworks built into J2EE as well as C# allow for robust development making it less likely that a developer will lose control of their code. Still, using these technologies and frameworks where a scripting language and a light framework would do adds un-necessary overhead to a project and can push deadlines out unreasonably.

Here's what I see. PHP is a fantastic scripting language that has no real back end and therefore is suitable for light to moderate customer facing websites and some intranet applications. Use of PHP in this regard will only continue to grow. I think some of the 25% decline in worldwide use is a reactive measure to PHP's early security vulnerability. PHP is losing ground quickly to ASP.net and VB scripting as Microsoft's Server 2003 is more widely adopted. Personally I think that LAMP is superior for many tasks, but ASP.net is almost ubiquitous now, hosting and maintenance are cheap. I'll continue to use PHP for light jobs, but at the same time I realize that this is just a preference and performance-wise ASP.net is better. Talking about Java… Sun needs to buy ColdFusion from Macromedia / Adobe. It should be THE Java application server. There is no cleaner and easier scripting language, and it has nearly unlimited flexibility and is design-pattern friendly. Why this move hasn't occured yet is beyond me. It would have made sense for Macromedia to sell it, but I think the issue is that Sun has many proud engineers who love to over develop products. The thought of supporting something as business friendly as ColdFusion probably makes them sick. The business case for this is probably that Macromedia probably sees the big picture and that there are big bucks in ColdFusion, especially now that enterprises are seeing it as a way to get around JSP's notoriously long development cycles.

I see scripting as having a bright future, and I'll tend to side with Zend's guys as saying that regardless of how the Evans study got its numbers, PHP is increasing in use not decreasing. I'm not sure if it is true, but if the next version of IIS is going to have PHP support built-in, I'll be seriously considering going with a Microsoft server in the near future and running it alongside ColdFusion. I like PHP, but I just like ColdFusion better.

news.com – Scripting's demise


Pondering Switching the Other Way

Posted: December 31st, 1969 | Author: | Filed under: Apple, ColdFusion, Programming, Uncategorized | Tags: , , | No Comments »

Pondering Switching the Other Way

Picture of Irv Owens Web DeveloperWhile I have been a Mac user for the past five years almost exclusively, I have been thinking lately about switching back to using a PC. The reasons for this truly stem from my need for the ultimate in geekery. I'd really like to get a dual-core Pentium 4. The tremendous advantage is that these cores also employ hyperthreading which to the OS looks like four discreet CPUs. Also, I have the urge to work in several 3D programs, none the least of which is Swift3D, that I have noticed run significantly faster on the newest Intel and AMD based machines than on the Macs.

But the Macs are going to go Intel you say. That is true, but the Mac prices aren't going to change. That is almost guaranteed. There is no way Apple is giving up it's hardware margins, nor should they. I have a choice, and I can get more bang for my buck going with a PC. This has always been true, but at one time I was happy with an iMac G3. The iMac has always been competetively priced relative to it's PC counterparts so I was content. When I first bought my G5 I was relatively content. Now the issue is that G5s cost about $2,000 at the entry level. I can take that money to Dell and get a Dual-Core P4 that will take it's lunch money on any given day, albeit with several crashes along the way.

But you by a Mac for the software, that is why it is worth it. This is true, and Mac OS X is definately superior to Windows XP and probably it's upcoming service pack, Windows Vista. I will miss it, but running Mac OS X does not enhance my productivity in any tangible way, it just looks better and the entire OS crashes less. I have had plenty of application crashes, which are about the same.

What it comes down to is what my current computing needs are vs my wallet, and in that game the Mac is at a severe disadvantage. We won't even talk about gaming. But the ultimate reason is my geekiness. I have a weak spot for Visual Studio 2005. After using several betas of the application via Microsoft's Express Beta program, I have to say I am impressed with the ease of developing using C# in this IDE. Their visual web developer software is equally compelling although unless I had to I wouldn't use ASP.net for just about anything. Not because it is bad, but because it takes so much longer to develop anything in than ColdFusion or PHP. Ultimately, my love of new technology and my desire to retain as much of my cash as possible is fueling this internal debate. I will probably not buy another Mac because of the cost, but at the same time I will not give up my iBook. I'll probably carry a Mac laptop for the forseeable future. My workhorse, the desktop however is definately another story.


Internet Explorer 6 Hangs with Multiple Connections

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, JavaScript, Programming, Uncategorized | Tags: , , , | 6 Comments »

Internet Explorer 6 Hangs with Multiple Connections

At work we are using the demis map server, which by itself is an incredible application. We had built a flash based client as our application to allow people to see images overlaid on top of the vector data digested by the map server. One of the issues we had observed with the application was that it tended to hang, or stop responding when a user would ask for many images to be shown on top of the vector map, then they navigated away from the current screen. Now, since I had seen the code and it was a mess with JavaScript setting cookies that ColdFusion was supposed to read and pass to flash, and images for checkboxes, I automatically suspected the code. However, the problem was deeper than that.

The code needs to be rewritten no doubt, there are many more efficiencies to be had, but that didn’t explain the hang. I combed over the server, watching response while a user was using the application. The map server stresses the machine, because it needs a ton of I/O and it would spike the CPU frequently, but no processes went to 99% CPU utilization, and the server seemed to respond to other clients even when one of them was hung up. It was pretty clear then that the problem wasn’t with the server. To take this logic a little further, we built a load test using wget and saving the result to a file. We looped over the calls as fast as we could and we never caused the map server to hang. It performed as expected.

The next logical step was to look at the possibility of corrupt files. We did notice that we could get the map server to crash when we fed it corrupt files, but we found no eveidence that the files that we were using in production were corrupt in any way. At this point we were plenty dejected, because we had spent something like 35 hours over a couple days working on this problem and we had nothing. We performed a new ColdFusion install on a different server, we built a server with better hardware, we reinstalled the map server application multiple times, nothing seemed to affect it. We even improved the network bandwidth available to the client, still nothing. At that point I was down to either it was the code, or it was the client.

To test this theory I commented out all of the flash calls on every page and went through the application to try to cause the system to hang. I couldn’t do it, so I had effectively limited the possible cause to the Flash movie. I started to go through what the Flash movie was doing, and what could cause it to fail. The demis people told us that they had seen hangs when the map server wasn’t responding, and the Flash player was parsing XML. This lead me to try the application in Firefox, and lo and behold, it never hung up. It worked like a charm. The only problem was that our client was set on Microsoft Internet Explorer

I started about the arduous task of removing all XML parsing from the Flash code, then I tried it and it still hung. I was truly disappointed, but I rethought what was happening with the XML. It was making server calls, I realized that I could have up to 8 consecutive connections going on. At the time I thought it was nothing, but then I started trying to find out what was different between Internet Explorer and Firefox. I happened upon an article on MSDN about a known bug that Internet Explorer will hang for 5 minutes when there are 2 persistent connections to a server, and rich content is downloaded. I had found my culprit. It turns out that I had to add 2 keys to the registry. MaxConnectionsPerServer, and MaxConnectionsPer1_0Server. I set the latter to 8 and the former to 24, hexadecimal. The keys need to be DWORD keys.

That would allow 8 connections for HTTP 1.0 and 32 or so connections for HTTP 1.1. The HTTP 1.1 guidelines recommend that there only be 2 connections allowed, but if Firefox wasn’t adhering to it, why should I. I added the keys to HKEY_CURRENT_USER>Software>Microsoft>Windows>Current Version>Internet Settings and it worked like a charm. Everything was perfect. Talk about looking for a needle-in-a-haystack. I’m still amazed that I found it.

The purpose of this entry is so that no one has to go through the week that I just went through. Generally no software should be in front of the client before it is ready, but in this case we already had a client. Hopefully this will help anyone out there who is experiencing hangs in Internet Explorer. Darn Microsoft and not fixing bugs for almost 3 years!

*EDIT Make that 8 years, since IE 8 appears to still suffer from the same problem!*

Here are some helpful links that might be better at explaining than I am…

Wininet Connection Issue

IE Hang Issue


Preventing Comment Spam With Spamhaus in ColdFusion and Java

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming | Tags: , , , , | 3 Comments »

Preventing Comment Spam With Spamhaus in ColdFusion and Java

Recently I turned comments on again for my blog, but I started getting hammered with spam comments so I looked into trying to figure out how to stop spammers.

Most people rely on some type of image based spam prevention. This is probably performance wise the best solution, the problem is when people with poor eyesight come in, or actual people come to spam your site. This solution doesn’t prevent that scenario.

A client of mine got me to look into SPF for protecting everyone else from someone masquerading as us. That somehow led me to spamhaus again. I had always thought of using them for spam filtering, but what I didn’t know is that you can use them for web submission protection. On the site, I learned that implementing their blacklist filtering is really easy to implement. Basically the way they work is that you supply part of your visitor, whether they are sending an email on port 25 or whether they are visiting on port 80, since Spamhaus includes their web site on their black list, if someone is sending spam mail, they will return for an http request.

Basically you have to send a request over to Spamhaus’ zen DNS server. If it returns a value, then they are a spammer, or at least they are listed at Spamhaus as a spammer. The method you use is you reverse the bytes of the IP address, for example if the IP address is 2.3.4.5 then you would send a DNS request over to Spamhaus like 5.4.3.2.zen.spamhaus.org. For Java and ColdFusion, I use InetAddress, but there are methods in every language to perform these tasks.

To do this in ColdFusion you could use code that looks like this:


<cfset address = CGI.REMOTE_ADDR />

<cfset addressArr = listToArray(address,".") />

<cfset newArray = ArrayNew(1) />

<cfset newArray[1] = addressArr[4] />

<cfset newArray[2] = addressArr[3] />

<cfset newArray[3] = addressArr[2] />

<cfset newArray[4] = addressArr[1] />

<cftry>

<cfset inet = CreateObject("java", "java.net.InetAddress") />

<cfset inet = inet.getByName(arrayToList(newArray,".") & ".zen.spamhaus.org") />

<cset hostName = inet.getHostName() />

<cfif hostName NEQ "">

<cfreturn />

</cfif>

<cfcatch type="any">

<!-- do nothing -->

</cfcatch>

</cftry>

To explain, in the first line you are starting a cftry / cfcatch block. The reason for this is if the visitor’s server is clean, it will throw an error because it won’t be able to get a response. However, if it doesn’t throw an error, it will be able to complete.

So the way this code works is that it takes the visitor’s IP address, splits it into an array, copies it into a new array, and then reconstitutes it into the IP address string but backwards.

It then creates an instance of InetAddress and calls the getByName method passing in the created address and waits for a response. If it doesn’t get one, it does nothing. If it does get one, and the result is something that isn’t an empty string, such as 127.0.0.2, it will return and not allow whatever it is protecting to be executed.

If you are using Java the code could look like this:

try{

InetAddress inet = new InetAddress();

inet = inet.getByName(backwardsip.zen.spamhaus.org);

// this should return an IP, but it really doesn’t matter what it

// returns

String hostName = inet.getHostName();

// this is just to catch a possible error

if(hostName.length() > 0){

System.out.println(‘Visitor is dirty’);

return;

}

}catch(Exception e){

System.out.println(‘Visitor is clean’);

}

So far this is proving to be a good way to check for bad commentors. The problem is that if you are a high-traffic site, Spamhaus will want to charge you for the use of their static list. If you are a high-traffic site, you would want it anyway for performance reasons. I think the cost may be worth it though in hassle.


ColdFusion Frameworks

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | 1 Comment »

ColdFusion Frameworks

Picture of Irv Owens Web DeveloperI have recently begun exploring the landscape of potential, mostly object oriented, controller layers for ColdFusion. Three of the frameworks that I have been working with are a substratum framework to add OO style to Fusebox 3, Fusebox 4, and Mach-II. In bouncing between these frameworks I have noticed that there are significant differences between all of them. In fact, I have noticed that for some tasks, one framework is better than another.

Taking Fusebox 3 first. It is possible to add your own CFC invokation layer to Fusebox. This works well for medium to small-sized applications, or applications that need performance. The reason Fusebox 3 works so well, even though it is so old, is that even with the many cfincludes it performs frequently better than Fusebox 4 and Mach-II due to their use of XML. The use of XML for their control files, instead of the fbx_switch.cfm file in Fusebox, enables developers to port their applications to different languages like PHP with much less difficulty. In order to port, you just need to recode your objects, you don't have to rethink how the application works. This is only of benefit however, if you intend to move the application.

The downside to using Fusebox 3 is that it requires much greater discipline from the developer. If you are commited to OO like development, and CFCs. You will have to enforce it yourself, the framework is not going to make you avoid procedural code. In some cases procedural is the way to go, but it is up to the developer to know this.

Fusebox 4 has much improved support for CFCs and OO like programming style. It uses listeners, can implement loop logic in the control files, and also allows freedom, to a lesser degree than Fusebox 3, to the developer to decide how they want to build the application. The XML control files are only read once if you set the framework to production, and then cached which enhances performance. Fusebox 4 performs almost as well as Fusebox 3 in my experience. If you use CFCs, inheritance, binding, and design patterns, it performs slightly better than Mach-II but significantly slower than the same application, coded differently in Fusebox 3 since Fusebox 3 doesn't support CFCs in the same way. It is possible to use design patterns in Fusebox 3, but it still seems just a hair faster. Granted none of this analysis is scientific, it is just my observations over time.

Mach-II I have talked about in earlier blogs, however it is still I think the best general purpose framework. It can perform somewhat slowly due to it's use of the application variable scope for almost all variables, and it's forced “implicit-invokation.” The variable issue can be avoided however by using var frequently in your objects to indicate local variables only. The error catching employed by this framework could use some work and there should be a built in way to cache invoked components to enhance performance, but these features will hopefully find their way into Mach-II 2.0, or a later version. In the hands of a skilled developer familiar with the framework, Mach-II can be very quick and scalable, however in the hands of a novice… Well, OO novices, and people really new to ColdFusion probably shouldn't touch Mach-II, it can be really frustrating. Truthfully the best framework for beginners, and people who have been using ColdFusion for a while, and want to get better at organizing their code should really look at Fusebox 3, in no time they will be ready to graduate to Mach-II. That is my opinion, and of course there are those people who can pick up a ColdFusion book and a Mach-II book on a weekend and be ready to code professionally on Monday, but most people aren't like that.

I've been thinking about trying to create my own ColdFusion specific controller layer, but it is difficult to keep it general enough for any application. Perhaps it would be better to group applications, and develop several frameworks that would work for certain groups. Well, I'll keep at it.

The Home of Fusebox
The Home of Mach-II
Tips and Help for Mach-II


Why Separate Business Logic From Display Code – Is That a Trick Question?

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | No Comments »

Why Separate Business Logic From Display Code – Is That a Trick Question?

Picture of Irv Owens Web DeveloperI was perusing the web the other day when I came across a site that was questioning the need for OO (Object Oriented) code in a language like ColdFusion. The author suggested that PP (Procedural Programming) was often faster as it involved much less overhead, and asked the question if it was truly necessary to strictly separate business logic from display code. I could see points in this persons argument up to this point. Not separate logic from display, was he mad? Still, to a developer who has not worked on complex applications, and has stuck strictly to commercial sites, I can see where the computing overhead and design complexity required of creating usable software would seem absurd. I can even see where EPAI (Every Page is an Island) can be of benefit in commercial sites with only several dynamic pages.

Having maintained large applications developed both with a framework and using elements of OO, as well as maintaining large applications built with no framework and EPAI, I can definately say that the applications developed with the framework and elements of OO are much easier to take care of. The primary reason is that there is a higher level of encapsulation per object, so that each individual object does only one task, and that task it could perform independent of any other objects. This way it is very easy to troubleshoot that one piece. As you continue through troubleshooting each piece you are most assured to find the issue. With EPAI, troubleshooting becomes difficult because each page has display logic mixed in, and can be performing several tasks, especially if it is sumitted to itself in forms. Even with appropriate variable scoping, it is still hard to determine what is setting what where.

I would suggest that the person who suggested that there was no benefit to separating business logic from presentation logic read Design Patterns by the Gang of Four, Gamma, Helm, Johnson, Vlissides. After reading a brief excerpt from the preface of the book I knew that it could help me solve some of my design problems. The issues in the book are real-world issues and as such the solutions make sense. After reading this book, the extra system overhead and complexity should seem worth it in many cases. However, this does not mean that it applies in all cases. Invariably there will be exceptions, for example where performance is the highest priority for a given operation. In this case you may wish to bypass the framework you have developed or are using for this operation, if the overhead it incurs is significant. This is just one example of many where design patterns and maybe even OO may not be the best solution to a problem. Remember, that is what programmers are doing, solving problems. Design patterns are just to give us more tools to do so.


Ruby on Rails

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | No Comments »

Ruby on Rails

Picture of Irv Owens Web DeveloperI'm definately suffering from infatuation with another web development language. I'm hesitant to call it love yet because I have been burned so many times before, but I think I love Ruby on Rails on first sight.

For a fully object oriented framework, Ruby on Rails is downright easy. Easier than easy. It also sports a very clean syntax similar to Python in its readability, and the fact that it does almost all database stuff for you is killer. I can see excellent applications for Ruby in prototypes, and perhaps web applications. I still think it needs to be used in enterprise, but it is holding up under some pretty heavy loads right now. I'll be working with it more in the coming days and weeks, as I am very curious as to how it will compare with ColdFusion.

For years I have thought that ColdFusion couldn't be beat for “Rapid Application Development.” But here is an application plus framework that beats it as far as time to market, but also does it in a completely OO way. I have been working to develop my own framework for a couple of days now, and I think that I'll start trying to mimic Rails' functionality for ColdFusion. But the reflection, etc… I don't know if I am up to the task of that.

The other nagging question about Ruby on Rails is how customizable it is as far as if you really want to get down to the nitty gritty. It does a lot of cool high-level stuff for you as far as the database interaction is concerned, but as far as delivering views that comply with XHTML Strict, and ECMA Script standards, I don't know. If I find myself having to rebuild all of the views from scratch it wouldn't be too bad, but I'd rather not.

One other really nice thing out of the many nice things about Ruby on Rails is that it creates nice search engine safe URLs for you, from the start. It truly seems that this language was made to be the web developer's language. It is so young now that to compare it to ColdFusion is almost heresy, but I find myself doing it.

Ruby on Rails


Yahoo Considered ColdFusion

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | No Comments »

New and Improved MSN Search

Picture of Irv Owens Web DeveloperIt seems that MSN has roughly the same amount of pages indexed as Yahoo and Google, and yet on almost every search they return fewer pages than either of it's contemporaries. I have noticed that MSN's relevancy tends to be pretty good, however it is possible to customize your queries to an extent with MSN with their sliders so you can choose whether you want the most popular results, the most current, or the most relevant via keywords. Also, MSN's search engine is much faster than Yahoo, and a little faster than Google, however this could be due to there being much lighter traffic across Microsoft's servers. But I would attribute the performance to a combination of good programming, and ASP.net.

I dont particularly like ASP.net, mainly because of the lack of a solid framework like struts for java to use. I also dont really like VB syntax, although I have to admit, in version 7 it is greatly improved. But back to searching, if you search for fusebox in Yahoo, you get about 1.1 Million records returned. If you perform the same search in Google, you get about 215,000 records returned. I believe that Google has had a recent shakedown of its index. In the MSN search you get about 245,000. In the Google results you get a lot of art studios, however in the MSN search you get articles about the fusebox framework almost exclusively in the first page of results. Yahoo gives you a mixed bag of results, seemingly alternating back and forth between the fusebox music site, and the fusebox web development framework. In my particular case I was thinking about the fusebox web development framework, but there is no real way for a search engine to know that.

Prior to this week, MSN's search results were pretty useless, Im glad to see that Microsoft is working to do things a little differently. I notice that in my case I have back-links reported in MSN, but they are not listed in Yahoo and Google. Still, I tend to place higher in the SERPS on Yahoo and Google, and often I shouldn't. I think Microsoft is branching out and using different algorithms, instead of checking Google's results and altering their algorithm based on the adjustments to Google's index. That is lame and I think that more search engines should try new things.


MySpace.com Switches From ColdFusion to Blue Dragon

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Microsoft, Programming, Uncategorized | Tags: , , | 1 Comment »

MySpace.com Switches From ColdFusion to Blue Dragon

Picture of Irv Owens Web DeveloperWhen MySpace decided to stop using ColdFusion recently, many ColdFusion developers felt somewhat betrayed by the change. Many even suggested that it wasn't the best engineered solution. By that they were hinting that by using fusebox, no one has said which version, and ColdFusion 4.5 / 5 they weren't working with the best that Macromedia had to offer.

New Atlanta claims in their press release that using the exact same code, MySpace was able to reduce their CPU usage by 50% under heavy load. They also claim that this result could not be duplicated with ColdFusion MX. I believe both of these claims. Most ColdFusion developers are loathe to admit it, but Microsoft has a pretty good thing going with C# right now. The ASP.net framework is decent, it performs extremely well in every test I have seen, so I am not suprised that by using ADO.net and ASP.net they were seeing gains like this. The biggest problem with any scripting or programming language comes down to the drivers when using an external resource. Web development is no different. When your database connection pool reaches it's limit, it just can't create any more connections and requests get queued. There is no way around this except to get better database drivers. I have seen JDBC fail miserably time and time again, especially with SQL Server 2000 in this area. One of the biggest causes of that 100% CPU utilization seems to be in the JDBC driver when the database doesn't respond in a timely fashion. I don't know what causes it, but it happens when I am working with a complicated dataset. It isn't even that the memory usage is too high and the server is thrashing, the CPU just goes to max and starts refusing connections. The only solution to this is to kill and restart the JRun instance. After that it behaves well again until it crashes.

In all fariness to Java / J2EE, I have only experienced these issues while working with ColdFusion Enterprise on Windows based systems, this doesn't seem to happen on Linux, at least in my experience. Since MySpace was so heavily invested in both ColdFusion and Windows hardware, I guess they had no choice but to use New Atlanta's Blue Dragon. Still, what most programmers have to realize is that at the end of the day, it is the tool that delivers the best that will be used. No matter what we feel about Microsoft, ASP.net is fast and stable in it's newest iteration. One of the advantages to ASP.net is that it automatically fixes it's memory leaks. This is something that Macromedia desperately needs to build into JRun. ColdFusion is sometimes slow and is often buggy when dealing with some of it's advanced features. Experienced CF developers know how to deal with most of this so it doesn't come into play very often, and I'd bet that with higher quality Microsoft SQL Server JDBC drivers, and the application of good design patterns and reusable CFCs they could have gotten better results out of the CFMX server. But as the CEO of New Atlanta said in his blog, to rewrite all the code to take advantage of components, invocation, and var typed variables is beside the point. They made the decision that would best serve their business. If their code was reusable or not is immaterial after the fact.

Still, I find ColdFusion's performance to be reasonable. I wouldn't call JSP / ColdFusion a speed demon any day, with light load, PHP blows it away with 10 users on it, but once you scale that up to 100,000 users concurrently, then Java starts to shine. Since Microsoft shamelessly copied Java with C# and improved on it, it is no suprise that ASP.net performs as well as it does since it has native OS support in Windows Server. No one uses ColdFusion because it is the fastest from the execution standpoint, they use it because it is the fastest language to develop in.

Another interesting point would be if Microsoft were to acquire New Atlanta in order to integrate ColdFusion support directly into IIS. This would give Macromedia / Adobe some competition and force them to fix some of the issues they have let languish in CF. It wouldn't be too suprising a move since they are seriously evaluating building PHP support directly into IIS. I'll bet that it wasn't even that tough for New Atlanta to port their J2EE version of ColdFusion over to ASP.net due to it's support for C# and Microsoft's Java source to C# source conversion tools. It, of course required some optimization, I'm sure, but I'll bet it is smokin'. Maybe I'll download it and try it.

New Atlanta
New Atlanta CEO's blog
House of Fusion MySpace Conversion Discussion