1

Running cold fusion standard, so i can only have 1 instance of the coldfusion tomcat host per machine.

https://helpx.adobe.com/coldfusion/configuring-administering/web-server-management.html#IIS says it's fine to have two websites send over to the same isntance, but i was wondering if it's still fine if the two websites are almost exactly the same code base, same file names, etc. We were looking at this option to run two slightly different sites of the same server, aka only change a few files and let vhost routing make it so different users get different experience.

I understand double the load means double the resources for tomcat, but we you can assume it's properly sized. I'm just wondering if there are technical/concurrent problems with doing it this way. EG: would coldfusion compiler cache things incorrectly, or maybe it uses distinct class loaders per IIS virtualdir, or maybe it's all checksum based on the hash of the cfm file...

Chris DaMour
  • 113
  • 4

1 Answers1

3

As long as each application has a unique name in application.cfc, it should work fine.

In application.cfc:

this.name = “this-needs-to-be-unique”;
Redtopia
  • 176
  • 1
  • 4
  • what kind of issues would i see if i left them both unamed? session collision? – Chris DaMour Sep 09 '19 at 20:19
  • They would likely share the same application space, but I’m not entirely sure. You could log or otherwise output the name from the application.cfc onRequest() method to see if they both share the same name. If they do, both apps will share the same application memory in the heap, so one could affect the other. They would also share the same session memory. – Redtopia Sep 09 '19 at 20:22
  • there's only 1 tomcat, so they're sharing heap no matter what. but it does appear that CF shards by application name https://helpx.adobe.com/coldfusion/developing-applications/using-web-elements-and-external-objects/integrating-jee-and-java-elements-in-cfml-applications/interoperating-with-jsp-pages-and-servlets.html so i guess if the session cookie worked for both sites (shared domain on cookie) they could collide, i'll have to test that out – Chris DaMour Sep 10 '19 at 16:33
  • Perhaps you could explain what you are trying to achieve. I’ve run multiple sites using the exact same code base on a single server for years. But they all had a unique application.name, which is an important distinction. If they all share the same name, then you’re going to run into some side affects, that may or may not be problematic, depending on what you’re trying to achieve. – Redtopia Sep 10 '19 at 17:07
  • can you give an example of a side effect i'd run into? – Chris DaMour Sep 11 '19 at 16:10
  • 1
    Since this is not the way CFML apps should be configured, I could only speculate. First, and probably most important, would be that both apps would share session data. But also since you said the code is *almost exactly the same code base*, then I would expect problems with the compiling/caching of the java byte code. I asked what you are trying to do because there's most likely a better approach than what you're proposing here. E.g., if you want two separate experiences, then do you split testing inside the app itself, and modularize the code changes into distinct independent units. – Redtopia Sep 11 '19 at 16:26
  • i appreciate the info. i want to do exactly what i've said, same code base with slight modifications. don't want to modularlize or split/muli tenant the app. I've been told bytecode template cache is based on fullpath to the source https://forums.adobe.com/message/11245538#11245538 and assuming trusted cache is off, based on timestamp of the file (and not a checksum!?! surprising). I've not read anywhere else that application name matters for template cache. got any links? – Chris DaMour Sep 11 '19 at 20:33
  • You’re running two slightly different code bases in the same memory space. They will share the same application and session resources. I wouldn’t be surprised if you run into problems. Can you explain why you don’t want to, or can’t set the app name? What is the use case? – Redtopia Sep 11 '19 at 20:45
  • OK assume they are only different for a moment during an automated deploy, then they are the exact same. but the use case shouldn't matter, i don't want an alternate option, i'm interested in why you keep saying app name needs to be set differently when i don't see that in the docs. you keep saying there will be issues, but when i ask for specifics you are saying you could only speculate. I'm not sure how much to trust what you're saying is all. – Chris DaMour Sep 11 '19 at 20:55
  • it's interesting that https://helpx.adobe.com/coldfusion/developing-applications/using-web-elements-and-external-objects/integrating-jee-and-java-elements-in-cfml-applications/interoperating-with-jsp-pages-and-servlets.html says "ColdFusion, therefore, supports only a single unnamed application." seems like unamed or same named would have same effect – Chris DaMour Sep 11 '19 at 20:58
  • I’m asking out of curiosity. I’ve been building CF apps for a long time and this has never come up. The use case is relevant when you ask the community for help. I honestly don’t know if you’re going to run into problems but I don’t know that for sure because I’ve never done what you’re proposing. Let’s say you run into problems? Are you suggesting that you can’t change your approach? – Redtopia Sep 11 '19 at 21:00
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/98555/discussion-between-redtopia-and-chris-damour). – Redtopia Sep 11 '19 at 21:19