News for hackers. Stuff that matters.
Re:MySQL Challenge: 100k Connections by anarazel on Monday February 25, 2019 @06:16PM (#19250425)
> I don't know how MySQL behaves in this regard, but in Postgres the number of transactions the system can run concurrently is roughly limited by the number of CPUs you have available. At some point adding more sessions just means that you will just end up with more lock contention, context switches and RAM usage.

That's only true if your transactions are all busy most of the time. Which in a lot of OLTPish workloads isn't actually the case. Both latency and the fact that applications need time to process such queries ensure that. IOW, I think this is better phrased as concurrently running queries, rather than concurrent transactions.

Re:MySQL Challenge: 100k Connections by taffer on Monday February 25, 2019 @07:02PM (#19250724)
> That's only true if your transactions are all busy most of the time.

And this is actually what you want from a performance point of view: Reduce the number of roundtrips and keep your transactions as short as possible.

Once a transaction locks a row or table, the lock persists regardless of whether the transaction is active or inactive, resulting in resource contention. The same applies to memory: if each connection has 10 MB of memory, 10 GB of memory is wasted for every 100 unused connections that could otherwise have been used for caching.

Re:MySQL Challenge: 100k Connections by anarazel on Monday February 25, 2019 @08:45PM (#19251335)
> And this is actually what you want from a performance point of view: Reduce the number of roundtrips and keep your transactions as short as possible.

Uhm, obviously. But it turns out there's other constraints too. Like whether optimizing for that to a significant degree in each application is worthwhile and/or realistically being done. And latency is a thing either way. It's extremely rare to not have briefly idle connections in OLTP context, even more so if the app code isn't heavily optimized for it (but even if).