Archive

Archive for September, 2009

White Label Social Networking Solutions Chart, Part II

September 21st, 2009

The marketplace allows for the display of client submitted skyscraper advertisements in JPG or SWF format (107×340). Multiple authentication schemes may be added in the future. Application Programming Interface (API) N N Y N N Y N Y Y N Y N Y Y Y Y N Y Y N Y Y Y Y Y Y Y Y N Network Privacy Settings Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Extensive

Source: http://www.techcrunch.com/wp-content/white_label_social_networking_solutions_chart2.html
>
White Label Social Networking Solutions Chart, Part II

admin Elearning

ZaidLearn: 8 Free Screencasting Tools For Tony!

September 21st, 2009

CamStudio Enables you to record all screen and audio activity on your computer and create industry-standard AVI video files and using its built-in SWF Producer can turn those AVIs into bandwidth-friendly Streaming Flash videos (SWFs) . Google Reader (Online RSS Reader)
skip to main |
skip to sidebar

Friday, October 31

Source: http://zaidlearn.blogspot.com/2008/10/8-free-screencasting-tools-for-tony.html
>
ZaidLearn: 8 Free Screencasting Tools For Tony!

admin Elearning

Interesting Information via eLearning Learning

September 21st, 2009

Ken Allan - Blogger in Middle-earth Ken talks about everything including some that come up for me Writing a Blog , Analytics , Communities of Practice , Photoshop , Pipes , Firefox , RSS . Mel Aclaro - Business Casual Mel has a lot of interesting topics, but clearly a lot around social topics ( Social Media , Social Networks , LinkedIn , Twitter , RSS , Social Network , Facebook ), but keep him in mind for Streaming , Privacy , and Internationalization . We’ve implemented a few features in the eLearning Learning Community . You can see the first feature

Source: http://elearningtech.blogspot.com/2008/12/interesting-information-via-elearning.html
>
Interesting Information via eLearning Learning

admin Elearning

The Digizex Debugger for Flash and Flex: Drop-in KapInspect and De MonsterDebugger without Breaking a Sweat [AS3] [6]

September 21st, 2009

The ultimate tutorial on how to create a content-managed, multilingual Flash website using Flash CS3 and opensource tools: FlashDevelop, Digizex, SWFAddress, SWFObject, Zend, Zend AMF, MySQL, XAMPP, PureMVC, Fabrication, Flight Framework Data Binding, BumpSlide UI Library, Demonster Debugger, KapInspect, Flex 3 SDK, Digitalus CMS, Minimal Remoting (AMF library for AS3), AllFlashWebsite’s FlashDevelop Project Templates. There are 8 videos totaling one hour.

Source:The Digizex Debugger for Flash and Flex: Drop-in KapInspect and De MonsterDebugger without Breaking a Sweat [AS3] [6]

admin Swf ,

Digizex Video Tutorial - Basic Structure of a Flash Web Site - CS3/AS3 - SEO,CMS,Multilingual,MVC [2]

September 21st, 2009

The ultimate tutorial on how to create a content-managed, multilingual Flash website using Flash CS3 and opensource tools: FlashDevelop, Digizex, SWFAddress, SWFObject, Zend, Zend AMF, MySQL, XAMPP, PureMVC, Fabrication, Flight Framework Data Binding, BumpSlide UI Library, Demonster Debugger, KapInspect, Flex 3 SDK, Digitalus CMS, Minimal Remoting (AMF library for AS3), AllFlashWebsite’s FlashDevelop Project Templates. There are 8 videos totaling one hour.

Source:Digizex Video Tutorial - Basic Structure of a Flash Web Site - CS3/AS3 - SEO,CMS,Multilingual,MVC [2]

admin Swf ,

Troubleshooting ColdFusion Performance: Analysis Part II

September 21st, 2009

This is part 3 in my Troubleshooting Coldfusion Performance series.  It was briefly interrupted by a great trip to CFUnited 2009, then catching up, but here it finally is! Several folks approached me at CFUnited with encouragement and enthusiasm for this series, I cannot tell you how much I appreciate that!  I’m glad I can finally give something back to a community that has given me so much over the years!
As this is part 3, you will most likely want to take a quick read over the 1st 2 posts in this series.

Troubleshooting Coldfusion Performance: The Problem
Troubleshooting Coldfusion Performance: The Analysis

So at this point, we have isolated and resolved a SQL performance issue using some of the tools that come with MS SQL. While this does not mean that our SQL configuration is now completely optimal, it has resolved the largest issue we are observing here, so we move on. Now its time to tackle our out of memory issues.
When your system is getting an Out of Memory exception, it can actually make it easier to debug than errors that only happen sporadically. There is a jvm argument that you can add to your jvm.config file that will cause a heap dump to be generated every time your server runs out of memory. Add this argument to your jvm.config file:
-XX:+HeapDumpOnOutOfMemoryError
Once you have this argument added, restart ColdFusion. Then you have the fun part of waiting for (or causing) an out of memory condition to occur. For Project X, we have 4 servers in our cluster, so we will add this argument to 1 server and bring it back into the cluster. Once it runs out of memory, the server will take a few minutes to shut down after it crashes, as it will build a text file in your {coldfusion}/bin folder with the contents of your memory at the time that the server went crashed.
Now you have a file, but if you tried to open your file in notepad, you may cause yourself more issues (the files are most often hundreds of megs, if not gigs in size).  There are several tools you can use now to open your heap dump and identify possible memory leaks. Here are 3 that I

find myself using.

Netbeans - Neatbeans is a full java IDE with tons of plugins, and includes a memory profiler and tools to view and explore a heap dump.
VisualVM - VisualVM is a tool dedicated to profiling, monitoring, and analyzing java application performance.
Memory Analyzer (MAT) - MAT can be run standalone or as a plugin integrated to Eclipse.  MAT has a slick feature that will automatically try to analyze a heap dump to find possible memory leaks.  While it has been hit or miss for me with ColdFusion code thus far, it has some great reporting and can make the heap dump a bit less intimidating.

So, this being a hypothetical project and all, I wrote a quick test case to show a simple memory leak.  You can download it here and check it out yourself to verify that these methods work for tracking down objects that are staying in heap too long.  After one request of the index.cfm file in my sample, capture a heap dump from within VisualVM.  Load it up, and switch to ‘classes’ view.  On the bottom of the classes view, you will see a filter.  Type in ‘cfl’ then click the green check-mark.  All of the CFC’s you create that go into memory are prefaced by ‘cf’, followed by your filename, then some compiler hash looking string of letters and numbers.  In this simple test case, we are looking for ‘leaky.cfc’, so filtering on ‘cfl’ will find them.  After 1 request, we will see something like the following.

Notice that the cfleaky2ecfc482229893 object shows 101 instances in memory.  The 1 instance is our ‘application’ scope variable, and the 100 instances are as a result of us running ‘doSomething()’ against it. When you run the index.cfm file another few times, then capture another heap dump, you see something like this:

So lets say we are observing this on projectX, where we have a class file that its instances count keeps growing like this on every request.  This can obviously start chewing up memory, and even after 20 minutes this memory did not get reclaimed in my local tests.  Now, in ProjectX, our codebase will obviously be much larger than the 3 files in my test, and isolating the code that creates this object would be much harder than looking at 10 lines of code.  To help us isolate this, we will use another technique I blogged about here, using hprof with ’sites’ to show objects that are in heap, and their stack trace associated to their creation.  For those who have not used a stack trace, its basically a road map on how the object in question was created.  Think of a request, where one method calls another, which in turn calls another, and so on.  Each method request will be a line item in your stack trace, which will eventually show you a file from which your object was created. After you stop your ColdFusion instance, you will get a file that is named {coldFusion root}/bin/java.hprof.txt. On my test, after making 20 requests or so, the file generated was about 32 megs in size.  When you open it up, you will see a ton of stack trace objects at the top of the file.  Scroll ALL the way down till you get to a list of classes and their count of instances in memory, and you will see:

I highlighted 2 items here, the right most one is the class name (the name of the compiled template called leaky.cfc), and the number to the left of it is the stack trace index.  Copy that number 368230 into the clipboard, then search for it in this file (above the list we are looking at now).  You will come to the stack trace that created this object, which looks like:

This technique can help you quickly locate the source of leaky objects.  Sometimes you will have to alter the depth of the stack trace to properly locate your object (this was run with a depth of 6, so it shows only the most recent 6 method calls).  In this very simple test case, changing line 5 of index.cfm will resolve the extra objects in memory.
Before: cfset request.leaky = application.leaky
After: cfset request.leaky = duplicate( application.leaky )
This simple example is just an illustration of how you can get yourself into trouble when pointing a reference to objects from a shared scope like application or server, into a local scope like request.  When we make a link from the request scope into the application scope, it maintains a reference such that the request variable would never go away until the referencing application variable gets garbage collected (which would wait for the application timeout).  By duplicating the object into the request scope instead, this ensures there is no reference to the application scope variable, which allows it to be cleaned up after the request completes.
This technique is great for identifying poor code practices, or errors in your objects.  With ProjectX, this technique will let you find and squash any memory leaks that are present.  Running this through several times until you no longer observe a constantly growing heap size will eliminate your memory leak, and let us proceed to other issues!
Next post I will talk about the iterative process of tuning your JVM configuration, using jmeter to simulate load while you observe some of your system metrics.
Remember, anyone who comments on any post in this series will be entered into the drawing for an Alagad backpack, which anyone who has one can attest they are totally sweet. Please feel free to contribute here, any comments are welcome to clarify anything I left hanging, and I will try and answer any questions that are posted!

Source:Troubleshooting ColdFusion Performance: Analysis Part II

admin Alagad

Troubleshooting ColdFusion Performance: The Analysis

September 21st, 2009

OK, time for a follow up to my 1st post in this troubleshooting series for our Project X, and I am going to talk about some steps we can take to better identify and isolate the issues today. I had some great participation on the last post, thanks to all who contributed (and you are entered for the backpack!). If you have not read the first post outlining the hypothetical scenario, do that before reading the rest here.
So the first step I usually take in any project is as simple as observation. Looking at task manager, and enabling the ’show kernel times’, will give us an instant pointer. Lets take a peek at one of the web servers while it is under heavy load, and we see this:

This graph tells us a few things. First of all, notice that the server is nowhere near using 100% of its possible CPU utilization, and notice the red line (which is the kernel or system usage). Kernel usage that is extremely high, or seems to follow the CPU usage like this one does, is often indicative of an I/O issue.  An I/O issue can be slow or overloaded disk resources, waiting on a network thread to complete, or waiting on database requests. As noted in the prior post, we are seeing Out of Memory exceptions after a time as well, but lets chase down issues one at a time here.
So, reading the CPU graph on the web server makes us suspect an I/O issue, lets try and confirm this.  One of my favorite tools for this is the use of hprof, a java code profiler that is built into the JVM.  I went over using a few parts of hprof in this post, and the part we will use to isolate this issue is the hprof=cpu=samples. Note, that making this change will require stopping and starting a production instance, but in this case the site is already going up or down.  I look at this as triage - errors are already occurring, and taking steps on a production server to more quickly isolate the issue is worth generating a few more errors on an already unstable system… I digress =)  Anyway, lets open up the jvm.config, find the line that starts with "java.args=", and add to it the following:
-agentlib:hprof=cpu=samples
After saving the jvm.config, you need to find the name of one of your coldfusion instances.  By default the first multi server instance is called ‘cfusion’.  Open up a command line, and navigate to your coldfusion root, then into the bin folder.  Enter the command:  jrun -stop cfusion.  After it is stopped, enter:  jrun -start cfusion.  You should see a lot of command line information spit out to the screen while it is starting.  Once it is done starting up, do whatever is necessary to get some production traffic going to the instance.  After it runs for a while (it will run a bit slower with the profiler running), press <control> C to end the instance.  Once the instance has shut down, you will find a file in the /{coldfusion}/bin folder called java.hprof.txt which has our method report in it.  In this hypothetical instances, we see our top 95% of method time (the CPU time spent in a given method) spent within java.net.SocketInputStream.socketRead0.  This is telling us that, for 95% of the time the CPU was being utilized, we were waiting on a socket to return data from a remote system.  In this case, the only system Java/ColdFusion is talking to is the database.  Now we have a 2nd confirmation (first the CPU graph, and now the hprof report) that is isolating an issue to the database, so lets move our investigation there.
Upon remoting into the database system, we open up task manager, and we see that the system is running at nearly 100% CPU usage. This can mean that is simply has too much traffic to keep up, or the queries that are being run are non-optimal.  As indicated by Geoff’s comment on my last post, at this point I would use SQL Profiler to capture some live traffic going to your database server, then run it through the Database Tuning Advisor to get index recommendations. I have seen production servers that have dropped, while under load, from 99% to less than 40% CPU usage, simply by applying the recommendations outlined by the SQL Profiler. In this hypothetical situation, lets assume we came back with something like that (estimated 70% improvement), and that bad SQL indexes were the root cause of ColdFusion being hung up in the database waiting for table scans. Re-running the hprof report after this shows a marked decrease in the time spent waiting on a socket response, so we can pat ourselves on the back for getting one point of contention resolved.
As several users noted in the last post, having a UNC path aliased from each web server to the shared SQL box is non-optimal. In this instance it was not the cause of our major issues, so we are ignoring it for now (yet noting it for later resolution).
There was some really great feedback on my last post, and next week (after CFUnited) I will post part 3 here, how to isolate and resolve the out of memory issues and use java debugging tools to trace them back. I had intended to go over the memory bits in today’s post, but its getting a bit longer than I wanted already =)  I share these and many other debugging techniques in my ‘Performance Tuning ColdFusion: Before the JVM’ presentation at CFUnited, which is Friday afternoon.I look forward to seeing some of you there!

Source:Troubleshooting ColdFusion Performance: The Analysis

admin Alagad

MSN bot was smashing Trac server, here is how I blocked it

September 21st, 2009

Just wanted to put a quick post out there.  I host about 50 trac environments on an EC2 server, several rather large ones of which are public and pretty high traffic.  Yesterday the trac server started having issues, and most of the logged errors had a seemingly random type of python trace data, followed by:
IOError: failed to write data
I dug around online for a bit but did not see much in the way of help for this issue, then I noticed that nearly all the errors were showing from a client that started with 65.55.X.X.  Flipping through other logs, it appeared to be an MSN bot agent hitting Trac pages, and in some cases even hitting an infinite recursion (somehow linking to /report2/report2/report2/report2/……). The quick and dirty fix to solve this issue was to block the entire subnet from accessing my vhosts, which was done with this little gem inside of each vhost <directory> tag in Apache:

 
Order Allow,Deny
Allow from all
Deny from 65.55.0.0/16

 
Granted this is not a perfect solution, but keeping the site up for real users was more important at the moment than allowing a rampant recursive spider to keep slamming the site as soon as I brought it back up (for nearly 2 days straight now).
Happy Friday!
 
 

Source:MSN bot was smashing Trac server, here is how I blocked it

admin Alagad

A New Series: Hibernate & ColdFusion 9

September 21st, 2009

Recently I have been working on a project using Groovy and Hibernate amongst other technologies and while I have definitely missed ColdFusion, it is good to get out of your comfort zone on occasion.  The problem with using new technologies in a project setting is that most of your focus is on delivering the project and not on really learning the ins and outs of the technology.  So, with a few minutes of breathing room allotted before the next project, I wanted to delve a bit deeper into Hibernate, especially with its integration into the next major release of ColdFusion.
To do this, my plan is to work through the book “Java Persistence with Hibernate” which was recommended to me and not only look at some of the capabilities behind Hibernate, but also see how Hibernate’s capabilities are presented within ColdFusion 9. This series should also serve as a bit of a review for the book and whether I would really recommend it for the ColdFusion development community.  To answer one question before it comes up, my point here is not to say that Hibernate will solve the world’s problems and that every developer should use it.  My goal is to simply take a closer look at Hibernate and the tools that we will have at our disposal with the next release of ColdFusion.  It is up to you to decide if these capabilities are worth your time and effort to learn more about.
Now, on to the book.  In going through some of the introduction and preface, I came across this definition of what Hibernate is:

“Hibernate is an ambitious project that aims to be a complete solution to the problem of managing persistent data … It mediates the application’s interaction with a relational database, leaving the developer free to concentrate on the business problem at hand.”

At first glance, this sounds great for a developer – I get to focus on the application and its architecture while ignoring the whole concept of data persistence within the application.  Reality is jumping up and down in the back of my head though saying this is too good to be true, so we will find out.
The first chapter of the book talks in general about persistence, how it fits into our software model and how it works in an object oriented paradigm.  I know my very first web application dealt with storing and retrieving data from a little Microsoft Access database, so the concept of data persistence is nothing new to me and I assume it is not new to most developers. The chapter talks a bit about relational databases – databases like Microsoft SQL Server or MySQL if you are not familiar with the term – as well as briefly discussing SQL in terms of the language for writing queries and communicating with the database.  While it is a well written intro, none of this should really be new for the average developer.
The twist with data persistence comes into play with what the books calls the “paradigm mismatch”.  In other words, what happens when you start developing applications in an object oriented fashion and have to deal with persistence.  With an object oriented application, you have abstract concepts like a Person and an Address.  However, a relational database does not understand the concept of a Person or an Address.  It understands a simple string like a first name or a street name for example. So, how do you go about saving and retrieving a Person instance to a relational database?  While you can obviously introduce a data access layer to your application that handles this conversion( this is discussed in the persistence layers section ) , this is the problem that Hibernate is attempting to solve amongst others.
The sub-section entitled “The Paradigm Mismatch” is very good in explaining the different issues in mapping objects to a relational database including granularity, inheritance, polymorphism, and identities.  The only thing here is that you have to have some knowledge of object oriented development and terminology, but I think that would be expected when reading a book on Hibernate which is all about persistence of object models.
I will cut this off here although I have only touched on half of the first chapter.  The sections on persistence layers are equally as good and as such, I will leave something for you to read about yourself.  I will look a bit more at the section that provides an overview of object/relational mapping (ORM) in the next post in this series.

Source:A New Series: Hibernate & ColdFusion 9

admin Alagad

Using hprof with Coldfusion to troubleshoot slow code issues

September 21st, 2009

I’m sure everyone has run into an issue that is difficult to isolate on a given system.  Sometimes all the code looks fine, and none of the .cfm templates are really standing up and shouting "I’m your problem!"  What to do when you are stumped and not sure where else to look for your performance woes?
Enter HPROF.
 
HPROF is a java profiler that you can invoke by modifying your jvm.config file. On ColdFusion multi server, that config file lives by default at {coldFusion root}/bin/jvm.config. When you open it up, you will see a few configuration variables being set, such as java.home (this tells coldfusion which JVM to use when starting up), java.library.path (sets the location for shared libraries to be loaded), and more, but the one we are concerned with is java.args.  By default it will look something like this:
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Dcoldfusion.rootDir={application.home}/
Once you modify your jvm.config file with the HPROF arguments (simply add the -agentlib:hprof=cpu=samples, or the sites argument, after the -server argument), you are instructing the JVM to gather the profiler information that you specify (in the hprof args), then once the JVM shuts down, dump that collected data to a file.  This file created, by default, is called java.hprof.txt, and will be located in your {coldfusion root}/bin folder.  So, to recap:

Modify your jvm.config file to add the -agentlib arguments as defined in bold below
Restart coldfusion with the modified config file
Run a good sample of your application (my preference is to run some jmeter testing)
Stop coldfusion (which triggers the generation of the java.hprof.txt file)

HPROF is a tool that is meant to be used locally for development, or on a test or staging server.  Running most of these arguments *WILL* impact performance of your application, so please do not run this on a production server unless all other avenues of investigation have been exhausted. HPROF has many different switches, but there are 2 that I have found to be the most useful so far.
-agentlib:hprof=cpu=samples
Adding this switch is asking the JVM to gether time data for each method call. The report that comes back will give you the java class that is consuming CPU the most, in a list that goes from highest consumer to lowest.  In the following output sample, this client has some database contention going on that is holding up other coldfusion threads, causing scalability issues.

rank
self
accum
count
trace
method

1
36.64%
36.64%
104470
300685
java.net.SocketInputStream.socketRead0

2
31.45%
68.08%
89676
301551
java.net.PlainDatagramSocketImpl.receive0

3
20.35%
88.43%
58023
300553
java.net.PlainSocketImpl.socketAccept

4
10.40%
98.83%
29655
301093
java.net.SocketInputStream.socketRead0

5
0.09%
98.92%
258
301720
com.rsa.jsafe.crypto.ap.a

As you can see, the report goes top down, from the most CPU time spent in a method, down to the least (not listed here for brevity). It gives you the count (number of times this method was invoked), the trace address (this refers to a stack trace ID, which is listed prior to this pretty list in the output file, and can be helpful in finding how these methods are called), and the method itself (which will quickly show you what exactly is being invoked). To find the associated stack trace, simply copy the trace number from this table, then search for it within the report.  With this sample output, all of the classes are java, but I have seen CFC’s in a stack trace show as large consumers of resources as well. This is a great investigative tool when you are not sure what is taking up so much CPU, or why your application is not running as quickly as it should.
-agentlib:hprof=heap=sites,depth=4
This jvm.args switch instructs hprof to provide an analysis of the contents of your heap memory at the time the application exits. The sites argument tells the JVM to group the output based on a stack trace of a specific depth.  The depth argument requests a specific depth of stack trace (each depth level will make your file take that much longer, and be that much larger, so only ask for stack traces of a minimal depth to figure out where the code is originating from).  This is a pretty poor sample, but if you have an object you are instantiating and its not going away, it will stand out very quickly when you view this output:

rank
self
accum
live bytes
live objs
alloc’ed bytes
alloc’ed objs
stack trace
class name

1
29.94%
29.94%
170401344
2812
172626464
3148
461666
byte[]

2
20.44%
50.38%
116307712
601
121153664
700
461595
byte[]

3
10.82%
61.20%
61554880
514
61554880
514
461600
byte[]

This output is telling you that 29% of the objects in heap are of a type byte[] (an array of bytes), that there are less bytes marked as live than there are allocated (some of the records have been marked by the garbage collector as ready to be collected), and that these byte[] objects were created with methods that are detailed in stack trace 461666. That stack trace looks like this:
TRACE 461666:
com.adobe.fontengine.font.FontByteArray.<init>(FontByteArray.java:56)
com.adobe.fontengine.font.FontByteArray.<init>(FontByteArray.java:63)
com.adobe.fontengine.font.opentype.FontFactory$TableToLoad.load(FontFactory.java:218)
com.adobe.fontengine.font.opentype.FontFactory$TableToLoad.load(FontFactory.java:259)
Sometimes these traces can be helpful in isolating the source of an issue, or at least giving you some direction from which you can base your investigation on.  When you have a stumper, sometimes a direction is all you need to get on the path to a resolution.

Source:Using hprof with Coldfusion to troubleshoot slow code issues

admin Alagad