-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
129 lines (116 loc) · 7.54 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!doctype html>
<html>
<head>
<title>FuseLess - Serverless CFML for AWS Lambda</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.1.3/sketchy/bootstrap.min.css" rel="stylesheet" integrity="sha384-5cy8WdlNAGqQwyB33aLiqJoRQQxZsc3TDUkSTahHAx2gMK3o0te7Xqm+nNLe4Ou3" crossorigin="anonymous">
</head>
<body>
<div class="position-relative overflow-hidden p-3 p-md-5 m-md-3 text-center bg-light">
<div class="col-md-5 p-lg-5 mx-auto my-5">
<h1 class="display-4 font-weight-normal">FuseLess</h1>
<p class="lead font-weight-normal">Tools for running Serverless CFML Lambda Functions</p>
<a class="btn btn-outline-secondary" href="https://github.com/foundeo/fuseless-template">FuseLess Template</a>
<a class="btn btn-outline-secondary" href="https://github.com/foundeo/fuseless">FuseLess Core</a>
<br><br>
<p>built by:<br><a href="https://foundeo.com/"><img src="https://cfdocs.org/assets/img/foundeo.png"></a></p>
</div>
<div class="product-device shadow-sm d-none d-md-block"></div>
<div class="product-device product-device-2 shadow-sm d-none d-md-block"></div>
</div>
<div class="container">
<h2 id="getting-started">Getting Started</h2>
<p>Let's get right to it, you want to run your existing code on AWS Lambda...</p>
<h4>Download the FuseLess Template</h4>
<p>Start by <a href="https://github.com/foundeo/fuseless-template/archive/master.zip">downloading a zip</a> of the <a href="https://github.com/foundeo/fuseless-template/">FuseLess Template</a> repository. Then extract it somewhere locally.</p>
<h4>Download Lucee & FuseLess Jars</h4>
<p>If you are on linux or a mac you can just run the <code>init.sh</code> script in the FuseLess Template zip and it will take care of it. If you are on Windows take a look at <code>jars/README.md</code>.</p>
<div class="row">
<div class="col-md-1"> </div>
<div class="col-md-10">
<blockquote>
Currently only Lucee is supported, it may be possible to get Adobe ColdFusion running on Lambda as well, but the size of the jar files would really need to be trimmed down to fit in the <em>250mb</em> code size limit. It would take a lot of experimentation to get it working, but I wouldn't say it is impossible.
</blockquote>
</div>
</div>
<h4>Add CFML</h4>
<p>The fun part... add some CFML to the <code>cfml/app/</code>folder.</p>
<h4>Package it up</h4>
<p>To package it up with all the jar depenedencies you will need to use <a href="https://gradle.org/install/" rel="nofollow">download and install Gradle</a>.
<p>Once you have it installed from the root of the template folder run the following command in Terminal or Command Prompt:</p>
<pre>gradle build</pre>
<p>At this point you will now have a CFML serverless application all packaged up in a zip file 🎉 </p>
<p>The zip file is located in <code>build/distributions/fuseless-template.zip</code> it can be uploaded to Lambda or tested locally using <code>sam local</code></p>
<h2 id="testing">Testing</h2>
<p>There are two ways you can test your code - many people test directly on AWS Lambda because it is the only way to replicate the environment. You may find it more convenient to test locally however, for this you can use the <strong>AWS Sam CLI</strong></p>
<p>First you will need to install <code>sam</code>, follow <a href="https://aws.amazon.com/serverless/sam/" rel="nofollow">these instructions</a>.</p>
<p>Once <code>sam</code> is installed and working you can simply run the following command from your Terminal or Command Prompt:</p>
<pre>sam local start-api</pre>
<p>This will start a local AWS API Gateway instance on port 3000 (by default). When you make a HTTP request it will spin up an emulated Java AWS Lambda docker container on each invocation. So you take a <em>Cold Start</em> initialization hit on every request in this mode.</p>
<h2 id="performance">Cold Starts & Performance</h2>
<p>No matter what language a lambda function is written in, one of the things you will have to deal with is the cold start performance. I have found that the Cold Start time averages around 2 seconds, which is not too bad. Once the lambda is warm, it can serve many additional requests at very high performance (I've seen CFML execution times in the single digit miliseconds with FuseLess!).</p>
<p>Ways to minimize the Cold Start Performance hit:</p>
<ul>
<li>Increase the amount of RAM that you give the lambda function</li>
<li>Decrease the size of your code zip (it has to download this so smaller code size means smaller cold start times). That is why it uses lucee light, instead of the full version.</li>
<li>Reduce number of CFML files that must be compiled for the request. On the first request your CFML must be compiled into Java Bytecode, it is cached for subsequent use, but every cold start will have this hit. You can <a href="https://www.youtube.com/watch?v=Yjy3bQJgphA" rel="nofollow">pre-compile</a> your CFML to avoid this.</li>
<li>Future improvements in Lucee 6 - the roadmap for Lucee 6 looks like it would allow for even better cold start times.</li>
</ul>
<h2 id="faq">Frequently Asked Questions</h2>
<h4>How fast is it?</h4>
<p>Running a simple Hello World CFML can execute on lambda in as low as <strong>~3ms</strong>.</p>
<h4>How big is the function code?</h4>
<p>A minimal deployment is currently around <strong>20mb</strong>! We are working to make this even smaller.</p>
<h4>How much RAM is required?</h4>
<p>It can work with as little as 256mb of ram but ColdStart times will be very high. Here are some possible Cold Start Request Times for different amounts of RAM</p>
<table class="table table-striped">
<thead>
<tr>
<th>RAM</th>
<th>Avg Cold Start Time</th>
</tr>
</thead>
<tbody>
<tr>
<td>256 MB</td>
<td>6 sec</td>
</tr>
<tr>
<td>512 MB</td>
<td>2-3 sec</td>
</tr>
<tr>
<td>1024 MB</td>
<td>1.5 sec</td>
</tr>
<tr>
<td>2048 MB</td>
<td>0.8 sec</td>
</tr>
</tbody>
</table>
<h4>Do all CFML tags/function work?</h4>
<p>Currently FuseLess bundles Lucee Light, which does not include any extensions so tags such as <code>cfdocument</code>, <code>cfsearch</code>, etc will not work unless you add the extension.</p>
<h4>How do I add Lucee Extensions?</h4>
<p>We are looking into ways to make this easy, <a href="https://foundeo.com/consulting/coldfusion/" title="ColdFusion Consulting Contact">contact Foundeo</a> for assistance.</p>
<h4>What other limitations are there?</h4>
<p>Lambda has several limits or constraints which are <a href="https://docs.aws.amazon.com/lambda/latest/dg/limits.html">well documented</a>. For example 15 minutes is the maximum execution time, you can only write to the <code>/tmp</code> directory (tip: use <code>ram://</code> instead), 50mb zipped package size.</p>
<h2 id="about">About</h2>
<div class="row">
<div class="col-sm-6">
<p>FuseLess was built by <a href="https://foundeo.com/">Foundeo Inc.</a> for questions, comments, support? <a href="https://foundeo.com/consulting/coldfusion/" title="ColdFusion Consulting Contact">Contact Foundeo Inc.</a> </p>
</div>
<div class="col-sm-6 text-right">
<a href="https://foundeo.com/"><img src="https://cfdocs.org/assets/img/foundeo.png"></a>
</div>
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-82573-22"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-82573-22');
</script>
</body>
</html>