
Evgeniy Resh
146 posts

Evgeniy Resh
@JoneKane6
I'm java developer and very love kafka
Katılım Aralık 2020
118 Takip Edilen1 Takipçiler

@Nekrolm @nuxituchka2 Ну как узкий, у нас целые модели памяти, которые дают seq consistency, если гарантируешь, что дата рейса не будет
Русский

Это не те гонки.
Rust не отлавливает race condition и никогда этого не обещал. И в целом это не очень-то и возможно. Rust лишь не допускает data race — очень узкий класс гонок, непосредственно связанных с памятью.
А всякие TOCTOU в нем отлично получаются как и везде:
user_id: Arc;
if is_root(&user_id) {
elevate_capabilities(&user_id)
}
между вызовами user_id может совершенно memory safely поменяться. Но при этом здравствуй CVE
Русский

Хорошо пошло.
Это очень хорошо, что все больше репортится ошибок в ПО на Rust — при всех его плюсах и гарантиях, Rust не устраняет логические ошибки. И чем больше будет репортов, тем раньше фанаты RIIR ради RIIR возьмутся за голову
habr.com/en/amp/publica…
Русский

@stealthbea29627 @ryanlpeterman Okay, then explain how cache could be better in distributed systems if it also remote as your storage? It probably will be miserable performance enhancing but we should think about invalidation and consistency
English

@ryanlpeterman He said this shit for clickbait and then had to defend it without sounding entirely retarded. That’s what happened.
English

Marc Brooker (AWS Distinguished Eng): "The downside of caches, especially in distributed systems, is they have this mode, where the cache is empty or contains the wrong data.
The system is slow, often down, because now the backend isn't scaled to deal with all of this uncached traffic.
Customers are very disappointed and often it is down in a stable way. Like it's still it's down, but it's not going to come back up under its own energy.
Because, for example, all of this traffic is causing a huge amount of contention in my database or is saturating the network and so I can't even refill the cache. It's not even getting the right kind of data in
In general, I prefer to see the teams around me avoiding caching where possible." @MarcJBrooker
Ryan Peterman@ryanlpeterman
Marc Brooker ( @MarcJBrooker ) is a Distinguished Eng at AWS who has been building distributed systems there for almost 2 decades. I interviewed him about technical learnings from his experience. We discussed: • Learnings from 3000+ post mortems • When caching is a bad idea • How software engineering is changing • Visibility and apparent expertise • How to find the best problems Where to watch: • YouTube: youtu.be/u3GjIXP9N0s • Spotify: open.spotify.com/episode/1qX2Gf… • Apple Podcasts: podcasts.apple.com/us/podcast/the… • Transcript: developing.dev/p/aws-distingu…
English

@valyala @systemdesignone I think it’s also about orchestration. Maybe not a complex one in context of docker(compose) but it’s still better than systemd(specially in a question of multiple replicas)
English

These facts apply to statically built executables without external dependencies. For example, services written in Go such as VictoriaMetrics and VictoriaLogs. In this case Docker is a pure overhead.
But Docker is useful for other services, which require the given environment to run, and that environment may consist of thousands of different files. Just put all these files into Docker container - and it works everywhere. Without Docker it is a nightmare to create and maintain the needed environment on the hosts where the service should run.
English

Вопрос специалистам по Linux и не только. Я тут занимался своими делами и случайно изготовил “fork-bomb”
Удивило то что Linux лег нахуй, и networking и все что в нем есть превратилось в ебучего зомби
Я честно не ожидал такого в 2026 году, никогда в эти вопросы не погружался, но логика говорила что система как-то по-любому должна оставаться живой, хотя бы чтобы зайти на машину и убить то что накосячено
Это можно порешать без виртуализации или система как пьяная блядь сама себя не контролирует?
И ради интереса, а с виндой и макосью тоже так? А что с FreeBSD, Солярисом, и прочими?
Русский

@Nekrolm А в си какие пляски? Там же у указателя только провенанс, а в случае совместимых типов оно ломаться не должно, не?
Русский

Я как-то об этом ранее не задумывался, а сегодня кааак понял:
В Rust, в отличие от C++ (да и C тоже), reinterpret_cast указателей не требует последующих плясок с launder или start_lifetime_as или еще черт знает чего.
Например, имея правильно выровненный буффер &[u8] его спокойно и безопасно можно кастить (через unsafe, или через помогалки из bytemuck) к &[T], если T не имеет никаких спец требований и невалидных представлений (Pod тип, если использовать deprecated плюсовую терминологию).
Указатели на нетривиальные типы, в целом, тоже можно кастить. Иногда с некоторыми заклинанания с MaybeUninit — например, для ручной реализации placement new.
И все просто от того, что в Rust нет strict [type based] aliasing rules.
Но зато в Rust нельзя так просто налево и направо кастить указатели к usize (uintptr_t).
Русский


@TheStackPilot @IamAroke We’re talking about local cache or what? Remote redis also gonna spend time on conns, concurrent control and memory access. In postgres for example we have prepared statement(they’re cached). So imho it’s not answering a question
English

Indexes speed up data lookup inside the database.
Caching avoids hitting the database at all.
Even with a perfect index, the DB still spends time on connection, query parsing, disk/memory access, and concurrency control.
Cache serves hot data in microseconds.
Index = faster search
Cache = skip the search 🚀
English

@Nekrolm А как такое достигается? Мы же не можем гарантировать, что какой-нибудь соседний процесс незатроттлит и ядро просто выкинет нас из шедулинга? Или какой-нибудь дикий branch мисс. Это best effort?
Русский

Вот, казалось бы, полгода работаю, а у меня только сегодня hello world заработал — не очень впечатляющее достижение...
С другой стороны этот hello world:
- Использует декларативный фреймворк для описания low latency микросервисов, который я пилю
- Проходит через минималистичный ECS, которую я написал зареверсинжинерив Bevy,
- Выполняет Zero-copy десериализацию, которую тоже я написал с нуля с поддержкой derive для кастомных типов, обеспечив десериализацию одного и того же сообщения РОВНО один раз, независимо от числа подписчиков на него.
- Проворачивает адовийшую compile time рефлексию, чтоб вызвать user-defined метод hello_world() с user-defined типами аргументов
- Крутит под капотом кастомные Futures, ориентированные на детерминистичный async runtime, которые тоже я запилил, совместимые со стандартным async Rust
И вот уже вроде и впечатляет. Хотя hello world всего лишь печатает hello world
Русский

@apachekafka Pull based model of clients is a big disadvantage for message queue because mq is good tool for inter communication if we need small latency and big scalability
English

Uh, changed my mind…
Apache Kafka@apachekafka
Public Service Announcement: Apache Kafka isn’t a message queue.
English

@zuhaitz_dev It’s also hard from memory model perspective, word tearing is sooo complex actually
English

What is better, 8 booleans in 8 bytes or 8 booleans in 8 bits. It is not as easy as just choosing one.
The first one is simpler in terms of CPU instructions, as having only 1 byte for 8 booleans will require shifts and masks, but the ALU is not the bottleneck, memory is.
In the first scenario it would need to fetch x8 bits of data from the memory. Which, for 8 booleans is not much, but for a large array (like a boolean flag for each pixel in an image) it will fill the L1, L2 and L3 caches a lot faster. A cache miss is a lot more painful than an extra AND/SHIFT.
It also depends on how we access the data. For looping, bit-packing will be the best as there's more data packed, reducing cache misses again. If it's for random access, a byte array surely wins (if the data set is small enough to fit).
I must also say that with bit-packing we can find race conditions as we cannot access bits atomically.
It is important to consider everything. But at the end of the day, if you don't worry about performance, use a byte array.
Programmer Humor@PR0GRAMMERHUM0R
cleverNotSmart redd.it/1r2m4ui
English

@SimpleMax2006 @mironov_fm @medvedwl Вам бы почитать вайтпепер битка, дичь несете. Даже 51% хешрейта(что нереально) не дает делать произвольные действия с транзакциями
Русский

@mironov_fm @medvedwl Для лопанья биткоина - достаточно провести "51% attack". И подозреваю, это под силу амерам, а может и китаёзам в любой момент уже сейчас.
Другое дело, захотят ли они едино-моментно зарезать и распотрошить дойную корову - или же предпочтут доить...
Русский

@mironov_fm @medvedwl Пузырь, которые никогда не лопнет - не пузырь, держу в курсе
Русский

@medvedwl Это не МММ, биткойны нельзя печатать бесконечно. Но безусловно, это пузырь. При этом этот пузырь может никогда не лопнуть
Русский

@abstract_artem А работу-то новую программистам уже пора искать? Или пока только agi для самих программистов?)
Русский

@Nekrolm Видимо, это одна из причин почему языки rc(типа свифта) работают хуже, чем с gc
Русский

@JoneKane6 Инвалидации кэш линий каждый раз, от чего сама хардварь начинает синхронизировать ядра для обеспечения когерентности кэшей
В посте кейс: атомик внутри Arc счетчика ссылок — его постоянно копируют: т.е постоянная запись (+=1, -=1)
Русский




