forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit60e612b
committed
Use ppoll(2), if available, to wait for input in pgbench.
Previously, pgbench always used select(2) for this purpose, but that'sproblematic for very high client counts, because select() can't dealwith file descriptor numbers larger than FD_SETSIZE. It's pretty commonfor that to be only 1024 or so, whereas modern OSes can allow many moreopen files than that. Using poll(2) would surmount that problem, but itcreates another one: poll()'s timeout resolution is only 1ms, which ispoor enough to cause problems with --rate specifications approaching orexceeding 1K TPS.On platforms that have ppoll(2), which includes Linux and recentFreeBSD, we can use that to avoid the FD_SETSIZE problem without anyloss of timeout resolution. Hence, add configure logic to test forppoll(), and use it if available.This patch introduces an abstraction layer into pgbench that couldbe extended to support other kernel event-wait APIs such as kevents.But actually adding such support is a matter for some future patch.Doug Rady, reviewed by Robert Haas and Fabien Coelho, and whacked arounda good bit more by meDiscussion:https://postgr.es/m/23D017C9-81B7-484D-8490-FD94DEC4DF59@amazon.com1 parent87d9bbc commit60e612b
File tree
6 files changed
+258
-42
lines changed- src
- bin/pgbench
- include
- template
6 files changed
+258
-42
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15093 | 15093 |
| |
15094 | 15094 |
| |
15095 | 15095 |
| |
15096 |
| - | |
| 15096 | + | |
15097 | 15097 |
| |
15098 | 15098 |
| |
15099 | 15099 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1562 | 1562 |
| |
1563 | 1563 |
| |
1564 | 1564 |
| |
1565 |
| - | |
| 1565 | + | |
1566 | 1566 |
| |
1567 | 1567 |
| |
1568 | 1568 |
| |
|
0 commit comments
Comments
(0)