Wednesday, May 20, 2009

ColdFusion performance and stability

Once in a while I hear a comment or a question about ColdFusion and its performance and stability. Usually this is coming from an experience where the CF environment was not architected well, not best practice. We follow best practices and our stability is 99.5% to 100% and usually its some maintenance or non web server outage that lessens that number.

Let me tell you that my team has been running several very success medical information sites for over 8 years on CF. One site now gets about 70 to 80 million page views a month. It uses FarCry for a CMS and does a lot of caching. Its no static site by any means of the imagination. Especially considering FarCry is not a page based CMS but rather the objects have views and the data can be displayed in a multitude of ways. Makes caching more fun that way. lol.

We have a host of other sites we run that are more db bound. One of them maintains about 1000+ logins an hour durring peak load. That is just logins, not counting users who are on the site already. It also rocks for stability and performance.

We run multiple instances of CF on our servers. Some servers have 5 instances running 5 different sites. Sure we do run in to times when we need to tune the code to utilize memory better but that's not a bad thing. By the way CF8 and a newer JVM gave us a nice performance boost. Some apps saw a 20% improvement.

My tips (from the top of my head):
  1. Use multiple instances to isolate applications.
  2. Use trusted cache and save class file settings if you can.
  3. Cluster - using a hardware load balancer.
  4. Use CFC's, ColdSpring and other frameworks where you can. Like Model-Glue.
  5. Use stored procedures or at least cfqueryparam
  6. Use a var scope checker.
  7. Use session scope to lessen db writes, this will require sticky sessions in a cluster.
  8. Look at you debug output and see where you can tweak performance.
  9. Look at your db performance, can you cache data, indexing...
  10. Benchmark and load test.
  11. Have a dedicated administrator who can actually spend the time needed on the servers.

If you follow best practices ColdFusion is very fast and stable.

No comments:

Post a Comment