aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
kenny 2019-10-17T17:02:16.000800Z

If I'm using a shared http-client with Cognitect's aws-api, is it ok to create many client records without calling stop?

ghadi 2019-10-17T17:02:56.001300Z

yeah if you're making many aws-api clients, calling stop will bork you

ghadi 2019-10-17T17:03:09.001800Z

we're working on this problem actively

ghadi 2019-10-17T17:03:47.002500Z

we're trying to slowly divorce ourselves from the current http-client, and have a BYO model

kenny 2019-10-17T17:04:18.003100Z

Sorry, so it's ok to do as I said?

ghadi 2019-10-17T17:04:24.003400Z

yup

ghadi 2019-10-17T17:04:36.003700Z

if you are sharing http-clients, you should avoid calling stop

kenny 2019-10-17T17:05:09.004500Z

Got it. With that BYO model, seems like this lib could be easily used in CLJS too.

ghadi 2019-10-17T17:05:30.004800Z

slow your roll 😉

ghadi 2019-10-17T17:06:04.005600Z

there are other concerns for CLJS, like signing routines

ghadi 2019-10-17T17:06:14.006Z

porting to CLJS has not been fully evaluated

kenny 2019-10-17T17:06:41.006600Z

Mostly interested in use in AWS Lambda.

ghadi 2019-10-17T17:06:43.006700Z

there is a ticket if you'd like to register your interest or a motivating case

ghadi 2019-10-17T17:06:53.007100Z

Cool, I suspected so. Is that because of startup time?

kenny 2019-10-17T17:06:57.007300Z

Yes

ghadi 2019-10-17T17:07:25.007800Z

what would be an acceptable startup time for CLJ lambda?

kenny 2019-10-17T17:08:18.008600Z

For this particular app, under 10s is ok. Cold starts result in 20-30s execution time with production deps.

kenny 2019-10-17T17:09:08.009600Z

Almost everything is written in vanilla clojure so getting it to work in Node would be somewhat easy.

ghadi 2019-10-17T17:09:32.010Z

yeah we can get there, my goal is under 2s for clojure + core.async + aws-api

ghadi 2019-10-17T17:09:58.010600Z

can't vouch for external deps, most are pigs

ghadi 2019-10-17T17:10:39.011700Z

might need a custom lambda runtime + JDK11

kenny 2019-10-17T17:10:49.012Z

2s would be fantastic. 10s is really pushing the limit for us but would likely be acceptable for a while.

ghadi 2019-10-17T17:11:06.012300Z

what are the deps you're pulling in, if you can share?

kenny 2019-10-17T17:13:52.012400Z

Pretty much everything in there is either cljc or has a JS client available. Largest missing piece is Datomic. Hoping they publish a protocol definition for the client API so we can have JS clients.

ghadi 2019-10-17T17:14:25.013Z

that is a ton

kenny 2019-10-17T17:14:44.013500Z

Yep, tis' the world we live in haha.

ghadi 2019-10-17T17:15:34.014600Z

the #1 thing you can do for startup time is to load less code

ghadi 2019-10-17T17:15:51.015200Z

datomic in a lambda is super weird

ghadi 2019-10-17T17:16:13.015900Z

if you need to connect to Datomic, consider running in an Ion -- free lambda

kenny 2019-10-17T17:16:20.016100Z

I actually don't think any one of those deps could be removed unfortunately. The only alternative is removing deps. Removing deps means writing the code ourselves which is sometimes hard to justify the engineering time.

ghadi 2019-10-17T17:17:51.018600Z

I just want to paint a realistic image that it is impossible to get fast startup time with bloated deps

kenny 2019-10-17T17:18:23.019300Z

Ions are too restrictive. There's no great way to instrument code in them. You're stuck with CW logs (unfortunately same applies with Lambda though). We have several extremely expensive, somewhat long-running ops that would almost certainly have a large impact on the Datomic instances.

ghadi 2019-10-17T17:19:23.020100Z

long-running ops -> not a good use case for lambdas either impact on datomic instances -> use a query group

ghadi 2019-10-17T17:19:36.020600Z

can you elaborate on code instrumentation?

ghadi 2019-10-17T17:20:34.020900Z

using honeycomb?

kenny 2019-10-17T17:29:20.021300Z

Long running = 5-10 min highly CPU intensive task. Yes

ghadi 2019-10-17T17:33:32.021600Z

seems really appropriate for an Ion, IMHO

ghadi 2019-10-17T17:33:40.021900Z

you can use honeycomb within an Ion

ghadi 2019-10-17T17:34:19.022400Z

Query Groups allow you to isolate the CPU intensive part so that it's not running on the Primary Group

ghadi 2019-10-17T17:34:52.023100Z

but you get the benefit of any queries happening locally instead of across the wire

kenny 2019-10-17T21:56:08.026400Z

@ghadi Sorry, had to step out for a while. Couple things there: - We're actually using Datadog APM right now, not honeycomb, but I assumed the usage was similar -- you need to start the jvm process with a java agent. I don't think Ions allow you to change the JVM args. - Running in an Ion requires you to run infrastructure 24/7. A huge benefit to running in Lambda is you only pay for execution time. - The Ion deployment model does not fit in very well with existing infrastructure tools (e.g., Terraform, Pulumi, AWS CDK, etc).

ghadi 2019-10-17T21:58:29.027300Z

honeycomb doesn’t use an agent, but agents are possible with Datomic Zion’s

ghadi 2019-10-17T21:59:35.027800Z

But I get you, there’s a ton of crap to consider

kenny 2019-10-17T22:01:06.028500Z

Oh they are? I didn't realize you could use Java agents with Ions.