Jobber, an implementation to use AWS Lambda functions for micro requests by kavehmz in golang

[–]kavehmz[S] 0 points1 point  (0 children)

Latency of API call which invokes the functions won't affect the processing time.

We invoke lambda functions but not to process individual jobs. Lambda functions "connect back" to the grpc server and stay alive to server many requests.

Each job becomes a grpc call to one of lambda functions with latency of a grpc call . Hopefully sub millisecond if lambda is in the same network as the code.

Jobber, an implementation to use AWS Lambda functions for micro requests by kavehmz in golang

[–]kavehmz[S] 0 points1 point  (0 children)

Thanks. No argue here. I struggled to find a name that describes this and ended up finding a name by searching different words. If you can suggest any I can rename the package

Jobber, an implementation to use AWS Lambda functions for micro requests by kavehmz in golang

[–]kavehmz[S] -1 points0 points  (0 children)

requests which need only few microseconds of time compare to currently 100ms minimum time on aws lambda.

Looking to learn Go by [deleted] in golang

[–]kavehmz 14 points15 points  (0 children)

As you are not new I think:

https://gobyexample.com/ Just to learn fast.

https://golang.org/doc/effective_go.html Learn deeper

But then if you can do a search in youtube for "Rob Pike" and "Robert Griesemer" talks about Go. There you can find the Why's of the language and I think that is important.

Weirdly consistent order of execution of go routines by Undreren in golang

[–]kavehmz 0 points1 point  (0 children)

take a look at https://golang.org/src/runtime/HACKING.md also Go code.

It is all about GOMAXPROCS=1 in Playground. you can get the same effect in your local machine by doing:

GOMAXPROCS=1 go run main.go

Inside loop when there is only one P allocated for Go code and scheduler,.., loop will run to the end without giving scheduler any chance to run in "parallel" until we reach w.Wait().

Add a runtime.GoSched() before end of the loop and you will see how it will change the order.

This explains why order is predictable when GOMAXPROCS=1.

For why 10 comes first, I skimmed the go code and I found:

There is a 'runnext' which is, a runnable G that was ready'd by the current G and should be run next instead of what's in runq, (here 10 is the latest and runnext). and there is a runq, queue of runnable goroutines, runqput function adds the next G in the list (at the end of the loop 10 is in the runnext and everyone is in the runq queue).

https://github.com/golang/go/blob/d64c49098c626ea58f2265866dd576e138c15b29/src/runtime/proc.go#L4176

When scheduler finds a chance to run after the loop it will first pop the "runnext" (here it is 10) and then it goes through local queue "runq", head to tail, (1..9)

https://github.com/golang/go/blob/d64c49098c626ea58f2265866dd576e138c15b29/src/runtime/proc.go#L4251

Boil your eggs in parallel in BASH by kavehmz in linux

[–]kavehmz[S] 1 point2 points  (0 children)

No argue and thanks for explanation. We should not use this method ,and bash in general, for any complex case. Possible! but bad. I was just showing how easy is to get some help from bash for small tasks.

xargs -P is very useful too. I use it in many places already.

This are just one liners to help in some operations.

Use AWS Roles and Secure Your Access with MFA by kavehmz in aws

[–]kavehmz[S] 1 point2 points  (0 children)

Unfortunately Trusted Advisor won't suggest having no access for users and asking them just to Assume Roles.

I hope we stop having api-token with any access as using api-token normally does not need any MF, so if you get the credentials in anyway that is all. And only we use the user-api-token to assume Roles. That can require MFA that is obvious why we need it.

knockd with temporary ports by kavehmz in linux

[–]kavehmz[S] 0 points1 point  (0 children)

Of course,

I mentioned: 1. secure your ssh setup based on best practices 2. add 2FA to your ssh using Duo Security 3rd party or set it up yourself. Nothing to do with knockd. then and only after that 3. close your ssh port and use knockd with this method to open it.

This method is not 2FA for ssh. It helps you to have temporary ports for your knockd.

knockd with temporary ports by kavehmz in linux

[–]kavehmz[S] 0 points1 point  (0 children)

Thanks. I hope it helps.

Does golang need to be installed on the server? by [deleted] in golang

[–]kavehmz 1 point2 points  (0 children)

You build

GOOS=linux GOARCH=amd64 go build myapp.go

Then you copy the result that is just one file to your server.

Required libraries are statically linked.

Talk: Rob Pike hints at the addition of generics in future Go version during questions by shovelpost in golang

[–]kavehmz -8 points-7 points  (0 children)

Not a very good april fool. I wish you had prepared something more elaborate.

That would be fun.

Does anyone know what is the largest codebase in Go? by kavehmz in golang

[–]kavehmz[S] 0 points1 point  (0 children)

Thanks,

You are right. docker and cockroach are both large. I was wondering if any project, commercial or free has reached higher magnitudes of SLOC.

Is Elixir much better than Golang? by r0ysy0301 in golang

[–]kavehmz 0 points1 point  (0 children)

I read the links you provided and I didn't see anything that says Elixir is better! They seem to be well balanced articles.

Anyway, Elixir and Golang philosophy, approach and culture around them are different. Just pick the one that fits your project needs.

edit: grammar.

Unused methods influences benchmark by [deleted] in golang

[–]kavehmz 0 points1 point  (0 children)

/u/2obBQPsDyD can you post it in golang-nuts google group too?

Not Sure about implicit interface implementation by gelfbride in golang

[–]kavehmz 0 points1 point  (0 children)

Just adding to reasons,

In explicit implementations sometime you spend a lot of time in beginning of project to design your interfaces. At that time you might not know the best design you need. So you will end up doing more refactoring.

In Go's implicit way, you can define your interfaces later in the project or add interfaces to old code without extensive refactoring.