|
|
Subscribe / Log in / New account

Sharing page tables with msharefs

Sharing page tables with msharefs

Posted Jul 15, 2022 14:32 UTC (Fri) by clugstj (subscriber, #4020)
Parent article: Sharing page tables with msharefs

Maybe Oracle should not spawn a process for each client.


to post comments

Sharing page tables with msharefs

Posted Jul 15, 2022 14:38 UTC (Fri) by willy (subscriber, #9762) [Link] (11 responses)

The database can work in a threaded mode, but performance on Linux is worse than the fork model.

Sharing page tables with msharefs

Posted Jul 15, 2022 15:28 UTC (Fri) by clugstj (subscriber, #4020) [Link] (7 responses)

Well, when given the choice between a performance hit and it crashing, I'd say you should pick performance hit.

Sharing page tables with msharefs

Posted Jul 15, 2022 17:11 UTC (Fri) by malmedal (subscriber, #56172) [Link] (2 responses)

If you don't care about performance you really shouldn't be running Oracle.

Sharing page tables with msharefs

Posted Jul 15, 2022 18:11 UTC (Fri) by k8to (guest, #15413) [Link] (1 responses)

But also, if you do care about performance you really shouldn't be running Oracle.

(Sort of a joke, because no one should be. But sort of true because they tend only win in the case of very fragile tuning that cannot be done in a timely way. And because of course if you spent that same money on hardware, you'd usually be better off with postgresql.)

Sharing page tables with msharefs

Posted Jul 15, 2022 20:20 UTC (Fri) by malmedal (subscriber, #56172) [Link]

I'm totally onboard with the no-one should be running Oracle sentiment :)

Several years out of the loop now, but I remember that Oracle, at least used to be, up to twice as fast as
PostgreSQL and MySQL on the same hardware and also the Magic Money Tree would provide far more money for
Oracle hardware since the license was so expensive :(

Sharing page tables with msharefs

Posted Jul 16, 2022 6:20 UTC (Sat) by mokki (subscriber, #33200) [Link] (3 responses)

Doesn't PostgreSQL also use fork per client model?

I was under the impression that thread per client model is faster, but less safe. In process per client model a bug in one client cannot corrupt memory in the process, outside the explicitly shared memory area.

Sharing page tables with msharefs

Posted Jul 16, 2022 9:44 UTC (Sat) by edeloget (subscriber, #88392) [Link] (2 responses)

> Doesn't PostgreSQL also use fork per client model?

Yes, but then, correct system architecture tells you to limit the number of clients to something that the machine can handle :)

If you cannot have 1500 clients on a signe machine, then maybe you shouldn't have 1500 clients on the same machine :)

Sharing page tables with msharefs

Posted Jul 16, 2022 9:58 UTC (Sat) by flussence (guest, #85566) [Link] (1 responses)

I've seen articles about database designs that, instead of routing things through a frontend web API or whatever, expose Postgres users and use its security rules model directly. I imagine that'd cause some scaling headaches if done to a medium-large website...

Sharing page tables with msharefs

Posted Jul 16, 2022 18:32 UTC (Sat) by butlerm (subscriber, #13312) [Link]

If your database server can handle the load in terms of number of connections, and your application can afford to be tightly coupled to the database design, and the connection latency is typical of a local area network, it is probably almost always faster to connect directly rather than running through extra tiers that mostly shuffle things around en route. In so many cases that is not possible any more though, even old school web applications multiplex database connections across concurrent users (and often do a outstanding job of it, but that is another story).

Sharing page tables with msharefs

Posted Jul 15, 2022 19:55 UTC (Fri) by josh (subscriber, #17465) [Link] (2 responses)

What makes it lower performance when using threads? Lock contention on the process mm? Something else?

Sharing page tables with msharefs

Posted Jul 15, 2022 20:52 UTC (Fri) by bartoc (guest, #124262) [Link]

Perhaps they want to COW some regions of memory while sharing others. This is quite difficult to do without fork/clone because as far as I can tell there's no other good way to create a COW mapping of another COW mapping. (On windows this is completely impossible, which is why you can't easily do things like forking game saves without implementing COW as part of your application's data structures). I'm not 100% sure how to do this on linux (without using fork/clone), maybe you can reflink tempfs files together or something.

Sharing page tables with msharefs

Posted Jul 15, 2022 22:59 UTC (Fri) by nickodell (subscriber, #125165) [Link]

Yes, exactly. From the May 17 article about this patchset:

> That raises an obvious question, he said: why not just use threads? The answer was that "mmap_lock sucks". It is also not possible to change the existing behavior of MAP_SHARED, since that would break programs, so there would need to be, at a minimum, a new mmap() flag if not a new system call. Aziz said that the separate system call makes the page-table sharing explicit rather than it just being a side effect. That makes the decision to opt into this behavior explicit as well.

https://lwn.net/Articles/895217/


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds