Upgrading the JRE used by ColdFusion - coldfusion

I have a ColdFusion 8.1 application. It gets heavy use and I see jrun.exe getting very high memory usage in the task manager. This is a 32-bit windows 2003 server. When Jrun gets around a gig of memory usage ColdFusion will stop responding at some point. The logs are a little vague, but I start to see garbage collection and heap errors in the ColdFusion log. I assume that the JRE is running out of memory.
I have the max JVM heap set to 1.2gig. After some experimenting, this seemed to be the biggest amount I could allocate and still have ColdFusion start ok. I realize that going to 64-bit might solve the problem, but that is not an option at this time.
I am considering upgrading the JRE (it is at v6.x dated pre-2008, though I don't know the exact version. I am using the JRE that came with ColdFusion 8.1. Has anyone gone through this? I assume it's just a matter of installing the new JRE and pointing ColdFusion to the new JRE directory in the ColdFusion server settings.
tia
don

it's EXTREMELY easy to do.
1) download the Java SE Development Kit and install it like normal.
2) open up the jmv.config for cf in a text editor, located in c:\coldfusion8\runtime\bin
3) comment out the existing java.home line with a by putting a "#" at the beginning of the line add a new java.home line below it pointing to your jvm installation.
As an example, my java.home and jvm.config look like this:
java.home=C:/Program Files/Java/jdk1.6.0_11/jre
4) restart the CF services.
As a bonus, you can running JavaRa and free up some space by deleting all the old versions of the JRE.

Adobe has a Knowledge Base that covers issues like this. Check out http://www.adobe.com/go/2d547983 for instructions.
Sean Corfield has an article that provides some info on using Java 6 with ColdFusion 8 here:
http://corfield.org/blog/index.cfm/do/blog.entry/entry/Java_6_and_ColdFusion_8
As long as you install 1.6.0_10 or greater, you should be fine. You might check out ColdFusionBloggers.org from time to time in case other JVM issues come to light in the future.

You didn't specify whether or not you were using the stand-alone server instance or a multi-server configuration. If you're getting a heavy volume of traffic and have a dual core machine with a lot of physical memory, I would consider looking into the multi-server set-up for CF8 and putting together a cluster with load balancing. This will help to distribute your traffic across several instances of CF8 and, assuming you have a beefy server, make better use of the physical resources that you have available.
-Rick

Consider moving Java 7. Java 7 has the G1 Garbage collector which is better at memory deallocation.
If you are having out of memory issues it could be because
functions are not using var or local scope
<cfdump> is used in a production system
Sessions are too large or are not set to expire in a reasonable amount of time
Queries are way too large SELECT * can cause that.
Excessive number Query of Queries.
The site is connecting to a slow database. Resources are held until the DB returns data
DSN has the data buffer set to more than 64k

Related

Can I run Eclipse che on a small VPS?

I have a relatively small VPS that I use as a remote dev environment :
1 vCore
2 Mb of RAM
I plan to have up to 3 dev environments on the VPS. I dont need to run 2 simultaneously however.
The biggest project is roughly the same size as a small Magento eShop. It is actually run by Python and Django.
The environment runs on Ubuntu + Nginx + uWCGI but this could be changed.
I can code remotely in the VPS using Eclipse RSE or Codeanywhere.
However Eclipse CHE offer very interesting functionalities for this type of remote environment.
The main risk is that the VPS configuration is very small. It is exactly the minimal configuration stated in the doc. I don't know if I can use it this way without making things really slow...
My instinct is "no", I think 2MB of RAM is not sufficient given that the Che workspace server is itself a Java application that needs about 750 MB of RAM. If you are running the workspace somewhere else, and just using the VPS as a compute node for container workspaces, I would suspect the answer is still no, as your container OS and language runtime will need more than 2MB of RAM. If you meant 2GB of RAM, it's still difficult, but maybe feasible, to run a workspace with a full Django environment on there, using a workspace server running on a separate host.
It sure would be nice to see if you can make it work, though - and I would love to hear if you make it work!

‘Service unavailable’ on ColdFusion 8 application service

I have often faced the issue ‘Service unavailable’ in ColdFusion website and need to restart the service manually. Sometimes, also need to restart the host computer.
I checked Event Viewer but I do not find any error related ColdFusion.
I am not familiar with ColdFusion.
Kindly help me. I would like to check why it happens and to solve this issue.
ColdFusion Version 8
Windows Server 2008 R2 Standard - Windows 7, 64bit
IIS Version 7.5
Thank you.
To find out what is actually crashing your CF server you may find information in the "out" log. Look in the /runtime/logs directory for a file called "coldfusion-out.log" or something similar. This is where standard out goes in a running CF application. There is also a /logs directory in your application that may give additional information.
Finally, you may have a hotspot error - an abend. Look in the /runtime/bin directory for a file similar to hs_err_pidXXX.log" (where XXX is some number). If you do have such an error take a quick look to see if it is an "out of memory" error. That's the most common.
I have a post on where all those log files are located. It is from the CF8/CF9 days so it may be useful to you. Of course everyone will tell you to upgrade as well. :) Good luck!
There are two places to look with problem like this: the application server behind CF (JRun for CF8) is the connector between CF and IIS. Adobe CF uses old (IIS6?) style ISAPI connectors that may need to be rebuilt - later versions of CF have a 'rebuild connectors' batch file in cfusion\bin\connectors (something like IIS_connector.bat) but it has been a while since I've had CF8 to look at. At the very least, be certain that you have the last CF8 update from Adobe as they sometimes want you to rebuild connectors after installing them.
A better solution for newer versions of CF (10+) is to use Bilal's Boncode AJP connector - I don't think it supports CF8 but haven't tried it.
CF 8's End-Of-Life was over four years ago and later versions stopped using JRun in favor of Tomcat, which is a bit easier to troubelshoot. If you have a development environment available, you might try running your codebase on CF10 or CF11; if you have to support this application for the foreseeable future, better to do it on something resembling a current version of CF. You could also have a look at Lucee 4.5 for an OSS alternative.

How to use Java Mission Control (or other solutions) with ColdFusion (tomcat)

The ColdFusion monitor is great for details about the server itself but it is pretty limited when it comes to the JVM.
How can one implement Java Mission Control or similar JVM monitoring solution to monitor the JVM running ColdFusion while you are developing and testing performance / memory footprint of applications and features?
Note that I am asking this question for "community knowledge" and already know the answer, but feel free to contribute any tidbits about other monitoring solutions.
Mission control used to be bundled as as it's own utility application in the JRockit JDK. Hotspot and JRockit were two entirely different JVMs with their own JDK/JREs. By default, ColdFusion uses the HotSpot JVM. JRockit is basically defunct from new development with some of its features being merged into HotSpot.
Java Mission Control is free for development purposes.
Get started, download the the latest 1.8 JDK. My preference is to uninstall all other 64-bit JDKs and JREs installed at this time.
This step might not be needed. Change your environment variable to update your JAVA home.
a. Right click "My Computer" -> "Properties" -> "Advanced" -> "Environment Variables"
b. Change JAVA_HOME and any other JAVA vars to your new path
Adjust your jvm.config
a. Make a .bak copy of C:\ColdFusion1x\cfusion\bin\jvm.config
b. Add the following lines to the jvm.config
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
-Dcom.sun.management.jmxremote.autodiscovery=true
-Dcom.sun.management.jdp.name=ColdFusion10
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=7091
-Dcom.sun.management.jmxremote.ssl=false
Open C:\program files\java\jdk1.8_**\lib\missioncontrol\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info file with administrator privileges and remove the four lines that start with the following text:
org.eclipse.equinox.log.nl_ja
org.eclipse.equinox.log.nl_zh
org.eclipse.equinox.supplement.nl_ja
org.eclipse.equinox.supplement.nl_zh
Edit the C:\program files\java\jdk1.8_xx\lib\missioncontrol\configuration\config.ini, and add the following line: eclipse.home.location=$osgi.install.area$
Start up : C:\program files\java\jdk_1.8.0_**\bin\jmc
Note that JMC is launching from 1.8 while your ColdFusion instance is running with whatever the latest Hotspot version you have installed with your ColdFusion updater.
You can install plugins from the help -> install new software. The plugins site should already be there. This will give you full on memory analysis of a heap dump. It's not nearly as good as the JRockit memory analyzer, but it's better than nothing.
If you are running ColdFusion as a Windows service, you will need to open services.msc and shutdown your ColdFusion Application Server. Then open C:\ColdFusion10\cfusion\bin\cfstart.bat to fire up Tomcat and ColdFusion as a foreground application. The jOverflow plugin will not work when running as a windows service.
You will see your JVM appear in Java Mission Control, mine is call -Xdebug since I guess it has no name and starts with the first option.
Right click on your ColdFusion JVM and select "Start JMX console". You will see something that looks like this show up on the right:
There is a whole lot to explore, including a lot of junk when it comes to examining memory due to having to sift through the ColdFusion Framework itself, but there are a ton of tutorials for deciphering what it means.
This video is your primary introduction: https://www.youtube.com/watch?v=WMEpRUgp9Y4
References:
https://www.youtube.com/watch?v=WMEpRUgp9Y4
http://www.ghidinelli.com/2009/07/16/finding-memory-leaks-coldfusion-jvm
http://www.oracle.com/technetwork/java/javase/jmc53-release-notes-2157171.html (see "known issues" section)

apache + django 1.3 memory issues

I've been running a medium Django 1.1 site without issues, for about 2 years, on a Linux server with 2GB memory. I had to upgrade to Django 1.3 (on the same server) in order to run a specific app and of course to take profit of the new Django features! However I've been experiencing terrible memory issues since :(
I've noticed that for every hit there is a huge increase on memory usage. This can't be due to expensive requests, because even for very single views the memory usage is high (eg 40MB).
I'm using mod_wsgi and I'm not running django on Debug mode....
Even with a few tenths of hits, the memory gets filled, the server starts swapping and eventually dies...a temporary solution is to force apache restarts and reloads every time memory gets filled.
But i have to find where the leak is. Is it django or apache? Could it be that the default configuration (I've followed the how to on the django and mod_wsgi page) along with the apache configuration creates the problem?
Any advise on how I should configure apache+mod_wsgi options is more than welcome!
Cheers,
N.L.
Try using some of memory profiling/analysis tools.
At least for me dowser was of a great help.
http://www.aminus.net/wiki/Dowser
So I've ended up integrating it more with django:
https://github.com/munhitsu/django-dowser
Good luck!

Whats the best way to get started with server virtualization?

We recently bought a new rack and set of servers for it, we want to be able to redeploy these boxes as build servers, QA regression test servers, lab re-correlation servers, simulation servers, etc.
We have played a bit with VMWare, VirtualPC, VirtualBox etc, creating a virtual build server, but we came across a lot of issues when we tried to copy it for others to use, having to reconfigure every new copy of the VM.
We are using Windows XP x86/x64 and Windows Vista x86/x64, so I had to rename the machine, join the domain etc for every new copy.
Ideally we just want to be able to add a new box, deploy a thin boot strap OS (Linux is fine here) to get the VM up an running, then use it.
One other thing we have limited to no budget, so free is best.
I would like to understand others experiences in doing the same thing.
FYI, I am not in systems IT, this we are group of software engineers trying to set this up.
Any links to good tutorials would be great.
The problem you're running into is the machine SID must be unique for each machine in a domain. Of course by copying an image you now break that unique constraint.
I'd suggest that you read the documentation for Sysprep in the reskit and Vista System Image Manager - your friends for XP/Win2k3 and Vista/Win2k8 respectively.
These tools enable to "reseal" your configured instance of the OS such that the next time it boots - it can prompt for information such as network configuration, machine names, admin user ID's, run scripts etc.
Also be aware that the licencing restrictions for Windows desktop clients are generally per image - not per server.
Using these tools with HyperV we created complete preconfigured instances of Win2k3 & Win2k8 that boot to finish installing Sharepoint - going further we used the diffing disks to overlay Visual Studio so our devs could use the production images for their work. It has radically changed our development process.
At this point our entire public website is run on HyperV with of 5 boxes running 15 images for a mix of soft and hard redundancy - they take several hundred million page views per week.
Another option for dealing with the SID probelm is NewSID. This is a simpler tool than sysprep, in that all it does is rename the machine and reassign the SID; if you don't need all the other features of sysprep this is a much easier tool to use.