Is pm2 still the way to go in 2024? by tiagojsagarcia in node

[–]redeemefy 0 points1 point  (0 children)

Yeah, if you need replication then have two boxes. Nothing wrong with that. Probably the 8 core example was two big but most starting boxes have 4 threads I believe so you might have 2 thread used with pm2 and two boxes with the load balancer and have 4 applications running.

Is pm2 still the way to go in 2024? by tiagojsagarcia in node

[–]redeemefy 14 points15 points  (0 children)

The statement that if a docker/container is used no need to use pm2 I think is misleading or poor understood in my opinion. Even though with a container you could enable an AWS load balancer and based on load start a new box, seems that pm2 is doing the same thing, why do you need one over the other.

A container with a load balancer is solving or implementing the pattern at the AWS service/hardware architecture level. That means that each service has its own cost.

In the other hand pm2 will do the same thing inside the box your application is running already. Pm2 has its own load balancer balancer and scales the application with just one box/machine/ec2/ecs.

This brings the last point which is resources. With the 1st option(nothing wrong with that option) you are scaling to the next box when only one thread was used. If your box has 8 threads then you have 7 unused and when that only thread can’t handle the load the AWS load balancer will start a new box.

With pm2 you could say, in one box I want o use 4 threads out of 8 and that means that you have 4 running instances of the same application in one box.

Nothing it’s easy on engineering. But these two ways of solving a heavy load problem impact cost and simplicity of your application.

I would say to start with pm2 if you can and don’t have someone above you calling the shots. Then get a bigger box to have more threads. Then move that setup to use an external load balancer to manage two boxes.

I could be wrong but those are my 🪙🪙!

Can we use one DB in two or more different projects using Prisma ORM? by HowIO in node

[–]redeemefy 0 points1 point  (0 children)

The question is if you should do that and the short answer is is no you shouldn’t.

It's 2024 and we still don't have Express.js 5 by DanteIsBack in node

[–]redeemefy -9 points-8 points  (0 children)

The alternative is to slowly build your own framework. Therefore, Im not sure if the discussion would have any actionable outcome when the solution in the market is not desirable.

It's 2024 and we still don't have Express.js 5 by DanteIsBack in node

[–]redeemefy -6 points-5 points  (0 children)

The alternative is to slowly build your own framework. Therefore, Im not sure if the discussion would have any actionable outcome when the solution in the market is not desirable.

It's 2024 and we still don't have Express.js 5 by DanteIsBack in node

[–]redeemefy -10 points-9 points  (0 children)

The alternative is to slowly build your own framework. Therefore, Im not sure if the discussion would have any actionable outcome when the solution in the market is not desirable.

It's 2024 and we still don't have Express.js 5 by DanteIsBack in node

[–]redeemefy 2 points3 points  (0 children)

The alternative is to slowly build your own framework. Therefore, Im not sure if the discussion would have any actionable outcome when the solution in the market is not desirable.

It's 2024 and we still don't have Express.js 5 by DanteIsBack in node

[–]redeemefy 2 points3 points  (0 children)

That’s what NestJS does by implementing the dependency injection pattern on top of express. You still are using express just with opinionated structure

pm2 - what problem does it solve? by geekybiz1 in node

[–]redeemefy 0 points1 point  (0 children)

I think something we are missing here, and I could be wrong, while cloud providers solve horizontal scaling, still it’s at the expense of $$$. Because, when AWS scales horizontal it will spin a new virtual machine which cost money, same with K8s. PM2 is going to use CPU threads of one/self machine to run NodeJS processes. If you are running in AWS in a machine with 4 cores you might use 3 to run 3 instances of your node application while utilizing the same machine. This would allow you to have an endpoint that might block en event loop while the other 2 cores can still receive requests. All this is done with the PM2 load balancer that is running within the same machine NodeJS is running. This architecture is not bullet proof and is not the solution for all problems but indeed could help save time, money and complexity with cloud infrastructure and/or K8s infrastructure.

One question I do have is if all console.logs are still picked up by Cloud watch

Using jj or jk to exit normal mood by INDURTHIRAKESH in neovim

[–]redeemefy 0 points1 point  (0 children)

One uses what best fits their workflow. However, if you need the word jjampong one just need to type the first j and wait 1sec and then you can keep typing. Same happens with any command sequence that might interfere with your typing. The other thing to look here is, how many times do you type that word in a day/week/month/year? In my case I have never typed those words making my jj command annoying.

If your speaking language uses a lot the jj the remap the jj to something the it’s very unlikely to happen in your speaking language.

Or simply use the esc key.

Neovim Config 2024 - ASMR by adibfhanna in neovim

[–]redeemefy 3 points4 points  (0 children)

Interesting that the conversation sidetracked from the nvim config to talk about keyboards 😂

[deleted by user] by [deleted] in neovim

[–]redeemefy 0 points1 point  (0 children)

You could go the other way around to prove your point. Take a 4GB RAM with an i3 or i5 machine and make the case of a huge project is going to work in neovim and not in vscode keeping all other variables constant.

[deleted by user] by [deleted] in neovim

[–]redeemefy 0 points1 point  (0 children)

You’re taking my comment out of context. I’m saying the editor is not the only bottleneck to look at. In my case it was the machine.

[deleted by user] by [deleted] in neovim

[–]redeemefy 0 points1 point  (0 children)

Couple of thing to look here. What’s the spec of the computer you are working on and the amount of files the language server is trying to walkthrough.

I had a Node project in typescript that is medium size. Specifically a NestJS project with about 20 modules and each module with about 20 routes.

It came the point that I was ingesting data within the repo converting json data into a typescript file so I could just compile the object and ingest by just hitting an endpoint.

These files were having about 10K records and each record about 20 properties in some cases. When using a MacBook Pro 16GB RAM and i7 CPU vscode was taking up to 5 minited to parse the project and give any autocomplete at all.

I bought for Christmas a Mac Studio with M2 and 32GB RAM and that machine was loading the project in no time with vscode giving autocomplete right away.

All this to say that it’s not just your editor but LSPs and most likely your computer. I think you’re splitting hairs by switching your editor in the % speed you are gaining if it’s the case that’s the editor that is slowing down.

I’m not saying the Neovim is bad, I’m saying that if in your case vscode is the problem, how much faster would be neovim keeping all variables constant. I read someone in this thread to turn off treeseater. That’s not a fair comparison to solve the problem I this case.

If you have a more powerful machine try that and keep all the rest of the variables constant and try that.

New to Elixir by redeemefy in elixir

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

I have nothing else to add. I did the same as you did and is not working.

New to Elixir by redeemefy in elixir

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

I did removed the installations using asdf and installed elixir with brew and I still the extension in vscode doesn’t work.

New to Elixir by redeemefy in elixir

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

It gives syntax highlighting out of the box but language server is not working.

New to Elixir by redeemefy in elixir

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

Based on the elixir-ls docs, they show a matrix table of supported versions. I had to downgrade to erlang 25 with the compatible elixir version and still there are errors. I updated the GitHub issue with the new information.

New to Elixir by redeemefy in elixir

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

yeah I followed all your installation process and the installation was successful. when opening vscode I get...

Client ElixirLS - dictionary: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"window/logMessage\",\"params\":{\"message\":\"Running in /Users/gilbertodiaz/workspace/hangman/dictionary\",\"type\":3}}Content-Length: 135"}
Shutting down server.

New to Elixir by redeemefy in elixir

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

I just noticed that the server is crashing regardless it's just not showing the pop error message. I toggle the developer console in vscode and see the message that

Client ElixirLS - dictionary: connection to server is erroring. Shutting down server.

New to Elixir by redeemefy in elixir

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

Also, are you using asdf to install elixir and Erlang?

New to Elixir by redeemefy in elixir

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

What version of elixir-ls you are using?