Is there any credence to this comment? "...cloud c...
# cfml-general
a
Is there any credence to this comment? "...cloud customers must pay for RAM, Processors, and Bandwidth due to CF using 8X more RAM than PHP."
s
I've never seen any data to support a statement like that. both can be pretty RAM hungry
a
I have no metrics, but anecdotally from my experience with both, but CFML is a glacial pig (if that's a thing) compared to PHP. So to get similar performance, one will need a lot more resources for a CFML app. It's also telling that PHP's memory management is measured in MB, whereas a JVM's is measured in GB these days. I dunno why bandwidth would be any different though?
I suspect Lucee's more economical with its memory usage than CF, but it's not gonna be the orders-of-magnitude different that it'd need to compare to PHP.
a
That's the feeling I got but I don't have actual metrics to compare to.
This comment was a response to ColdFusion being used as a backend API platform for a React front end.
The company has legacy CF systems that are being redeveloped and the age old question of "why CF" came up.
a
I doubt there will be objective metrics comparing.
"why CF" came up.
Might be a good time to look at what it'd take to start migrating away.
Because it's a poignant question.
s
Our legacy CFML apps (running on Lucee on Tomcat for years, then on CommandBox) needed pretty large heaps (we ran one of them with 13GB at one point I think and as we've rewritten things and shifted traffic we came down to 6GB on that one; most of those CFML apps needed 4-8GB). Most of the Clojure apps we run today use anything from 512MB with a few in the 1-2GB range, with just a couple using 3.5GB and 4GB respectively (and the latter is primarily because of some heavy image processing it does).
The JVM is still pretty "greedy" compared to PHP though.
a
Objectively speaking, is the difference between having a ACF server and a PHP server so disparate that the cost of running one vs the other would be astronomically different? (Licensing aside)
d
Maybe ask the person who said that for evidence. If you want to start down that road...
a
Thanks for the replies fellas. Sounds like there is some meat to this but its hard to prove without actual metrics
b
Some random numbers: • For a baseline, I can start a CommandBox undertow server (no CF servlet) for static files on 25 MB of RAM • I can start a CommandBox undertow server with Lucee and it will consume about 40 MB of heap on start • I can start a CommandBox undertow server with Adobe CF and it will consume about 300 MB of heap on start Heap usage measured by FR and FWIW, it's more on Java 11+ than it used to be on Java 8.
1
1
Now, that said, how much RAM an app needs to perform well under load is based on a ton of factors like what that app is doing. Many people I've seen run CF apps with way more heap than it needs, but it doesn't hurt anything. It would be hard to get good numbers without actually having to identical apps side-by-side, one running CF and one running PHP under the same load and the measuring their memory usage.
Keeping in mind a JVM will tend to use all the RAM you give it because the GC is lazy, so just because you give a CF server 12 Gigs and it's using 10GB doesn't mean it requires all 10 to perform well.
👍 1
a
Good stuff Brad, that gives me some potential discussion points. Thanks!
e
In the realm of JVM vs PHP memory and performance. Tomcat / Coldfusion pre-allocates memory, up to the hard limit on the VM, java constraints or your configuration values. CF is written in Java and has all the strengths and weakiness of Java, including that it still runs nearly half as fast on twice as much hardware. Oracle had made really great strides on their SPARC platform, but at the end who the hell still has a sparc in production? PHP is a C /C++ product that has all the underpinning strengths of the two. It's just going to be faster, and more memory efficient than JAVA. Facebook spent tens of millions on their own work on PHP to make it faster and even more memory optimized. So if you want just who runs the fastest code vs the two, its PHP. Now lets get down to coding, If you like spending millions of hours screwing around with micro updates to PHP code as some jackass upgrades your cluster from 7.4 to 8.1 and suddenly thousands of lines of code no longer work as someone added the "GLOBAL" attribute to the code which no longer works (like an application scope) but now needs refactored as it now works like a local array, Great, PHP why the hell are you here? If you like your code only to need to be refactored as you want additional functionality, or found a better way of doing something, COLDFUSION all the way. Seriously, seen cold written back in the days of NT 4 was still in use. It's sad, but it just works, and that's what some need. So in the end, do you want a shiny new "Car" that every X you need to trade it in, repair, repaint, refinance, and buy another one kind of like it but requires you to physically change everything about the way you drive, live, eat and work, or do you want a car that you buy once, and pay maintenance every four years for someone to throw a new engine in it, for the sake of better gas mileage and the door locks in compliance with keeping criminals from jacking it.
👍 1
👍🏻 1
a
You were making sense until this bit:
If you like spending millions of hours screwing around with micro updates to PHP code as some jackass upgrades your cluster from 7.4 to 8.1
That's upgrading across a major release (7 -> 8 ), not a "micro update", so it's stupid to then bang on about being blindsided by backwards compat issues. Also PHP is very good at documenting breaking changes well ahead of time, and much better at it than Adobe or Lucee. Plus it's alpha and beta programme is open to the public. PHP has its faults (OMG some of the syntax!), but none of that stuff you said is one of them though. if you got caught out by that, I'd be looking a lot closer to home than anything PHP 8 changed. Whilst PHP is not great compared to other more modern options out there compared to CFML it's light and day. It's (largely) a better language (design; functionality), more stable platform, more active and mature (veneration, and quality of developer) community, and - as per this discussion - leaner on resources and faster at the same time. It's just... better than CFML. A bunch of CFMLers like to think "at least it's not PHP", but along with a lot of other ways, they are stuck in the past and are comparing to PHP 3 / 4. And there was some legitimacy to having a chuckle at how rubbish PHP was then. But it's not 2003 any more. At least not in the world outside certain CFML echo chambers.
e
I have covid and still working from home.  As for version code changes, going from 7.1 to 7.4 breaks things, and going from 8.0 to 8.1X breaks things.  Yes, I code PHP and yes, the documentation is second to none but it's a constant pain in the ass that the language keeps "evolving" over what sometimes is very trivial matters IMHO..    ASP in 2003 was killing it back then, and PHP 4.  PHP 4 was not all that bad, it just was "new" Sorry, Fever induced rant (many lines deleted)
a
hahahahah (sorry to laugh at your misfortune) I think they were pretty good at pointing out what was gonna change between the various 7.x versions? But yeah, one needs to actually read the release notes. Behaviour changes generally seemed to be bugfixes though? I was out of PHP by the time 7.4 was in the works, and have never looked at what comes with 8. I have shit break in Lucee between releases of x.y.Z level of version differences. And if CF did releases that frequently, then they would too cos they're not great at noticing breaking changes across releases except in situations where it would be really frickin good if they broke backwards compat to fix a bug, but just stick to the "backwards compat is very important to us" work-avoidance tactic.
e
Here is my take, here we are 2022, Power apps is killing it as its "low code" cloud enabled crap, and I use the word crap as IMHO, its "BULLSHIT", I digress. Microsoft none the less is making a killing as they built it into their ecosystem and give it away for free as power apps for desktop, and power apps as part of even the most basic paid business services. Adobe had their chance to shine, make a few license changes and give away AFC while selling AFC "ENTERPRISE" to governments, schools, and everyone else and still keep their cash cow mooing, instead they let it die, dropped any kind of real marketing efforts for it, gave in to 1980 style marketing and continue to hope that 1980 style marketing as with Adobe Acrobat will somehow make their product GREAT. Meanwhile, Microsoft has successfully given away what was a 2500 IDE to everyone, and then added a few new microfeatures and now every programmer graduating from school is all but brainwashed into thinking they MUST use a Microsoft IDE/compiler as that is what is taught. Why? Well marketing, in short. Back to PHP vs CFM.. in 2003, Everyone was selling ASP or CFML, in 2022 PHP is mostly free and used for everything, Python is gaining adoption, and CFM is very much alive, well, and thriving in government, private enterprise, and high-security installations everywhere. Is it as sexy as PHP, nope, but I can train a fresh kid out of college using a book that is nearly as old as they are in a week to write code, whereas if I throw them at say, Powershell or . PHP it could take months.
a
IME I am not even sure it is a CF v PHP thing; most cloud service providers have a model where everything is priced based on RAM, HDD and CPUs regardless of what is actually installed.
e
When you buy a VM, you do so as you plan on running or developing X. For most applications written in PHP, you can throw on a lamp stack for 20 a month and not blink twice for small installs. Tons of documentation, tons of open source products, closed source products API ,samples and oodles of developers everywhere eager to help you do something. Hire an entire offshore development team for the price of a full tank of gas. 🙂 As for Coldfusion, it's always been more of a roll up your sleeves and just do it kind of language. I equate the language to drug addiction as once you have mucked around with it, You want to use it more in everything.
a
Oh absolutely - in that sense, yes, CF can be more expensive IF you go down the VM route. Not sure about all providers but you can also containerise CF/Lucee and I am pretty sure hosting a container is cheaper than a VM
e
Really not sure if it's "Cheaper", but a lot of people do not do their due diligence on ROI. If the application is just out of the box, never needs "tweaked" sure go with that, whatever "that" is. If you have something that is unique to your "company" and will require adaptation over time and you do not want to spend a fortune on hiring programmers or a small shop or have other budgetary items, ColdFusion all the way. If you want to do exactly what every Western Government and nearly every Fortune 100 does, including stock exchanges and national banks. Coldfusion. If you like pain, suffering, and watching everyone lose their minds. Go ahead, pick something else.