DO NOT USE localhost | Prime Reacts

DO NOT USE localhost | Prime Reacts

ThePrimeTime

10 месяцев назад

299,761 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@kjartannn
@kjartannn - 02.12.2023 05:01

If something breaks on IPv6 for you, you or the software you're running is the problem. The address family is not to blame for the fact that a program cannot open a socket on v6.

Ответить
@TON-vz3pe
@TON-vz3pe - 30.11.2023 23:08

2% of what exactly? Performance?

Ответить
@aes0p895
@aes0p895 - 29.11.2023 06:15

also CORS issues. localhost can get funky w/ cors.

Ответить
@divad1196
@divad1196 - 28.11.2023 21:21

I don't believe the 2% improvment. Will need proofs

Ответить
@skilz8098
@skilz8098 - 25.11.2023 17:10

The one case where using magic numbers over a conventional descriptive name proves to be more adequate...

Ответить
@Benony91
@Benony91 - 25.11.2023 16:34

Am I really the only like on this video or is YT poopin’?

Ответить
@tytyterrell
@tytyterrell - 22.11.2023 16:36

IPv6 sucks. Not a programmer…networking and info sec guy. It suuuuucks for any local network

Ответить
@HyperionStudiosDE
@HyperionStudiosDE - 21.11.2023 00:04

A 2% reduction in latency is not a 2% reduction in server costs, not even close. It's still a nice win.
But I'm wondering, wouldn't it be much better to change the config to look up ip v4 first and continue using localhost? I assume that must be possible.

Ответить
@lpls
@lpls - 20.11.2023 15:59

How much he'd save if he used an OS that works out of the box instead of spending a huge amount of time figuring out why the wireless driver no longer fits the kernel every distro upgrade?

Ответить
@lpls
@lpls - 20.11.2023 15:56

I'm not sure I trust this metric of 2% savings. 2% of what? An initialization time? Or... why are you resolving localhost a few times a second?

Ответить
@lpls
@lpls - 20.11.2023 15:51

Counting syscalls while using Python sounds like an April fool's joke.

Ответить
@uis246
@uis246 - 18.11.2023 18:44

We all know that localhost lookup doesn't make any DNS requests on any Linux distro. libnss just reads it from /etc/hosts.

Ответить
@Triavanicus
@Triavanicus - 18.11.2023 14:35

We were severely limited with ipv4 namespace, then NAT happened to

Ответить
@sound4mation
@sound4mation - 17.11.2023 01:06

there is the option to completely disable ipv6 on the host and none of this would even be an issue. Unless you are part of the .001 percent of people out there actually using ipv6

Ответить
@Alex_Khouri
@Alex_Khouri - 13.11.2023 01:32

On the topic of IPv6 breaking things, I came up with a system for a university research project that would expand IPv4's address range from 4 billion to 280 trillion. It involved converting the 16 bits used for packet fragmentation into an address extension, based on a study I ran which showed that packet fragmentation is rarely used in real-world web traffic these days. I also discovered that companies were collectively paying around US$1 billion per year (in 2019) to buy IPv4 addresses from organisations which had been hoarding them over time, so there's actually a pretty big financial incentive for tech companies to invest in the change.

Ответить
@MrTbirkett
@MrTbirkett - 12.11.2023 20:17

One of the biggest improvements that I ever made to a service was optimisation of SSL/TLS cipher ordering.

Ответить
@kevin.malone
@kevin.malone - 09.11.2023 08:07

I'm going to use localhost. I don't care what the video says

Ответить
@im7254
@im7254 - 08.11.2023 16:26

nobody uses docker runs

Ответить
@jordixboy
@jordixboy - 08.11.2023 11:23

This doesnt make much sense in enterprise level. You rarely use local host to reach any other service.

Ответить
@burlak3182
@burlak3182 - 03.11.2023 13:20

I think this is wrong solution for the problem.

With asumption that /etc/hosts lookup doesn't cost anything and real problem was trying to first resolve ipv6 just mean there is missconfiguration in vm/containers itself. And correct solutiotion would be properly configure /etc/hosts and remove ::0 if you don't support ipv6.

Replacing hostname with ip address doesn't really sounds good.

Ответить
@NDKS1
@NDKS1 - 01.11.2023 04:10

those stupid idiots using localhost

flicks straight back to my other tab localhost:3000

Ответить
@NFvidoJagg2
@NFvidoJagg2 - 01.11.2023 03:59

breaking on IPv6 is a bug

Ответить
@austecon6818
@austecon6818 - 31.10.2023 05:22

All seasoned python programmers know about this already. Ran into this same problem 4 years ago. Back then the dns lookups were really slow sometimes too.

Ответить
@CallMeKeule
@CallMeKeule - 30.10.2023 15:32

Are people using localhost in production environment? How/Where?

In my world, "localhost" gets overwritten via settings/conf/env in prod by actual DNS addresses (i.e. DB, rabbitmq). I only use it in local development and e2e testing.

Ответить
@happosade
@happosade - 30.10.2023 11:39

Maybe, just maybe, the correct solution is to keep using localhost and disable ipv6 on your host if you're not using it.
Working to enable ipv6 in production and man do I hate everybody who does this, since this is operating systems concern, not program's.

Ответить
@SChassisWeekly
@SChassisWeekly - 29.10.2023 08:52

Me, a single dev: wondering if the 2% efficiency boost over the course of my life time per hot reload is > or < the 8 minutes spent watching this video, + the time it takes to lookup my ip each computer startup.

Ответить
@MoistFalafel
@MoistFalafel - 25.10.2023 04:06

Programmers talking about networking is HILARIOUS lmao

Ответить
@userasd360
@userasd360 - 22.10.2023 20:31

expose the port and use localhost

Ответить
@J0R1AN
@J0R1AN - 22.10.2023 13:25

Nobody supports IPv6 because nobody supports IPv6

Ответить
@lashlarue7924
@lashlarue7924 - 21.10.2023 09:54

"to be fair, you are using python"... which is ok if you're a semi-human and need to communicate codey ideas to other semi-humans.

Ответить
@johnnyj4425
@johnnyj4425 - 20.10.2023 19:45

Very true, I've used this in the past to fix an issue I had using xamp and myphp admin on Mac.

Ответить
@kepleremeritus4899
@kepleremeritus4899 - 16.10.2023 04:13

Disable IPv6 on all your net adapters and disable Toledo virtual NIC. Problem solved.

Ответить
@EzequielRegaldo
@EzequielRegaldo - 16.10.2023 01:08

Don't trust anyone who still uses "Command prompt". Seriously

Ответить
@wurf5336
@wurf5336 - 08.10.2023 20:55

so I should use localhost because someones shitty macbook did not work properly ?

Ответить
@randysmith4964
@randysmith4964 - 07.10.2023 22:11

I feel like this take completely ignores python virtual machines for distributions

Ответить
@oefzdegoeggl
@oefzdegoeggl - 03.10.2023 17:01

what a nonsense. every idiot knows that a call to getaddrinfo() is slower than hardcoding the IP. and "no", getaddrinfo() is NOT a syscall, it comes from libc and is not a passthrough. oh wait. he is doing what? using windows?? oh lord. no idea where they implemented it there.

Ответить
@peterlogo1193
@peterlogo1193 - 02.10.2023 18:37

😆 why the shade on python? Amazing content 😆

Ответить
@JoelHatmaker
@JoelHatmaker - 27.09.2023 06:07

Some of us become chads at different rates

Ответить
@SlavomirDanas
@SlavomirDanas - 24.09.2023 18:28

Meanwhile (in our universe):

BenchmarkDotNet v0.13.8, macOS Ventura 13.6 (22G120) [Darwin 22.6.0]
Apple M2 Max, 1 CPU, 12 logical and 12 physical cores

| Method | Mean | Error | StdDev | Ratio | RatioSD |
| ConnectToLocalhost | 71.14 us | 1.208 us | 1.438 us | 1.00 | 0.00 |
| ConnectTo127 | 71.19 us | 1.389 us | 1.706 us | 1.00 | 0.03 |

Because hostname resolution is cached in memory and is just one memory access away. You must be doing something terribly wrong if you can measure 2% difference in resolving cached hostname...

Ответить
@nonnnth
@nonnnth - 24.09.2023 14:23

Python is so slow py dev had to care about performance, meanwhile js dev can just write poopoo code and imagine it being blazingly fast because v8

Ответить
@gabrielomane-yeboah
@gabrielomane-yeboah - 24.09.2023 00:09

Same problem pops up when using MongoDB
Currently using a MacBook Pro 🥲

Ответить
@nickfarley2268
@nickfarley2268 - 22.09.2023 00:25

On Linux when you listen on IPv6 localhost you can get both IPv6 and IPv4 connections from the socket because IPv6 is awesome

Ответить
@TheBlackmanIsGod
@TheBlackmanIsGod - 21.09.2023 19:05

For the record I didn’t know if it’s not DNA it’s always ipv6, so no not everyone knows what you know…

Is it the misconfigurations or compatibility problems that lead to service disruptions??

Ответить
@ovalteen4404
@ovalteen4404 - 21.09.2023 17:39

If you aren't forcing an address family on getaddrinfo lookups, then ALL lookups have the potential to return IPV6. Google, Microsoft, Apple, etc. all have IPV6 addresses.

Ответить
@robmckennie4203
@robmckennie4203 - 20.09.2023 05:16

i like how prime is like "we need to migrate to ipv6 but it's a pain" watching a video advocating hard coding an ipv4 address into stuff, which is one of the things making migration a pain lol

Ответить
@e995a1ad
@e995a1ad - 18.09.2023 02:47

If your code wants IPv4, maybe pass an address family to getaddrinfo?

Ответить
@BerenddeBoer
@BerenddeBoer - 11.09.2023 12:13

So what happens if you're on an ipv6 only machine?

Ответить