Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldIWQ-0005JE-8I for pgsql-general@arkaria.postgresql.org; Sun, 02 May 2021 20:16:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ldIWO-0005iH-0X for pgsql-general@arkaria.postgresql.org; Sun, 02 May 2021 20:16:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldIWN-0005iA-Ov for pgsql-general@lists.postgresql.org; Sun, 02 May 2021 20:16:55 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldIWI-0003ZT-0h for pgsql-general@lists.postgresql.org; Sun, 02 May 2021 20:16:53 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 85F2F4A87; Sun, 2 May 2021 22:16:45 +0200 (CEST) Date: Sun, 2 May 2021 22:16:45 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Is this the future of I/O for the RDBMS? Message-ID: <20210502201645.GB6136@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hHWLQfXTYDoKhP50" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-05-02 14:49:44 +0100, P=F3l Ua Lao=EDnech=E1in wrote: > While perusing the interweb, I stumbled on this very interesting blog > post from TiDB. >=20 >=20 > https://pingcap.com/blog/tikv-and-spdk-pushing-the-limits-of-storage-perf= ormance >=20 > It talks about the Storage Performance Development Kit (SPDK) (spdk.io). This sounds certainly interesting. Without reading up on the details, however, I notice that it implements a file system in user space which means that the kernel cannot enforce any permissions. This may be ok for a database (which typically runs as a single OS user anyway), but it is something to consider. It looks somewhat similar to Oracle's "raw device tablespaces" of the 1980s. By the time I got involved in database programming in the late 1990s these were considered obsolete (negligible performance advantage, but a hassle for the DBA). Maybe with NVME SSDs and persistent memory like Intel Optane it is time to revisit that idea. There are less intrusive possibilities, though: Linux has recently (kernel 5.1 - oh, that is already 2 years old) aquired a new async I/O API named io_uring, which eliminates the system call overhead. I haven't played around with it myself, but some blog posts report quite substantial performance improvements, in some cases approaching the theoretical limits of the used (very fast) SSDs. > Will this have any implications for PostgreSQL, given that it is a db > that compiles/runs on a large number of systems - or can subsystems > such as this be integrated/included for those chips which support it? > This particular SDK appears to be Intel specific, but if one chip > manufacturer can do it, can't they all (eventually)? I don't think the chipset makes much of a difference. It's an open source library written in C - it can almost certainly be recompiled for ARM or whatever. It will almost certainly be linux-specific, though. It's probably possible to write something similar for Windows, MacOS, FreeBSD, etc. but I have no idea how hard that may be (maybe you just have to change a few system calls - maybe you have to rewrite 80 percent of it). More important for PostgreSQL is whether something like this can be incorporated without changing the overall architecture: If you just have to change a handful of functions performing low-level I/O, it may be worthwhile even if only a few systems (Linux systems where the DBA is willing to set up devices for direct access from user space) benefit =66rom it. If it means rewriting large parts of postgres and then some platforms cannot be supported at all or only at reduced performance, this is not an option. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --hHWLQfXTYDoKhP50 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmCPCKgACgkQ8g5IURL+ KF3UoQ/9HOHVmS8vkAjNqv+h6HV/vV+QxAoOiWuQrWeOxVJrOF2MM26Xc21qugLw W9L6y4IBHRpWciO0nGbslIO+RYtbio883psfjkpgLm2KwSG12rtxGfp2uy93sy8V Kg7wprbKRtC245IWhMOtbLDjcNQR6R43mv+jXj+LLfy6ACkUqWD5tbIAq5p365tt KkgOLjLVbTqcPJ35cERyJzTMW8SFICuHu471zq6XTIk+XvARVq5SiBhjhBuriuzi 4jhJtPR3mGktq9J5s9fh1IPG6Vc7xhBv39OkSjFkF5FkcDynUOTZTb1/Pi6C584c k4G0X1fKsY+BMe59XB0HxOqrsPXKHqXhE8HfTnh3o04phUCihWUf3lpQAeeXp7ah 6k/8zazsd1fSzSghZPsaKwX0opUbGZIePxDHbKdYAznllsx8lLMynBUmNfjaXe6i PCiMQy23KhUrK815mwEIS70b8nQOOIz+DwzxKoZU7CK9FIhpknnyEk7mzvLjrq0Y F+RL95Bc+x9qhugkVUzlsR5Nsd383Ohpqpzo9Fur6KGY6bxBkOm1B5WZhBQ0dy20 6sMt0/e3ShewqgRXUKUmwJWS6siSEe1+H1RHdz/yvZP4u4oTF+qZfNmU8zWKXj5f FEddQaa8sua93np7Chajy8LQT6m8254ViWdOOOGtZLqAPS73wGA= =rhP+ -----END PGP SIGNATURE----- --hHWLQfXTYDoKhP50--