[pgpool-hackers: 3861] Single shared memory segment for Pgpool-II main process

Muhammad Usama m.usama at gmail.com
Tue Dec 15 00:16:12 JST 2020


Hi

I was trying to run Pgpool-II on Mac OS/X 10.15.7 and it was refusing to
start up with a
"No Space Left on Device" error.
The reason for that was a default limit on the maximum allowed of
shared memory segments (kern.sysv.shmmni: 32).
Although increasing the limit did momentarily solved the problem until I
tried to ran the second and third Pgpool-II node on the same system (to
test watchdog).

This made me realize that while the shared memory segment is a limited
resource yet
Pgpool-II opens too many shared memory segments.

In total Pgpool-II opens around 20 shared memory segments and a few are
just 4 bytes in length
Shared Memory:
m 2031616 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2 348160  35040  35040 21:47:21 no-entry 21:47:21
m 720897 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2    320  35040  35040 21:47:21 no-entry 21:47:21
m 786434 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2     20  35040  35040 21:47:21 no-entry 21:47:21
m 851971 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2   5264  35040  35040 21:47:21 no-entry 21:47:21
m 589828 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2      4  35040  35040 21:47:21 no-entry 21:47:21
m 589829 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2   9216  35040  35040 21:47:21 no-entry 21:47:21
m 589830 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2  12288  35040  35040 21:47:21 no-entry 21:47:21
m 786439 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2     26  35040  35040 21:47:21 no-entry 21:47:21
m 589832 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2      4  35040  35040 21:47:21 no-entry 21:47:21
m 131081 0x02382d74 --rw------- muhammadusama    staff muhammadusama
 staff      6     56  27293  27293 23:55:48 21:47:06 23:55:48
m 786442 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2      1  35040  35040 21:47:21 no-entry 21:47:21
m 27459595 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2      1  35040  35040 21:47:21 no-entry 21:47:21
m 4521996 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2     24  35040  35040 21:47:21 no-entry 21:47:21
m 3080205 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2     40  35040  35040 21:47:21 no-entry 21:47:21
m 3014670 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2     40  35040  35040 21:47:21 no-entry 21:47:21
m 3014671 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      2  80904  35040  35040 21:47:21 no-entry 21:47:21
m 1703967 0x00000000 --rw------- muhammadusama    staff muhammadusama
 staff      0  80904  27968  27968  0:04:52  0:04:52  0:04:52


So I cooked up a patch to avoid creating too many shared memory segments by
creating a
single shared memory segment big enough to hold all required shared memory
and put all shared memory variables within that segment one after the other.

What do you think about the changes?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20201214/ed39dc68/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: single_shared_mem_segment.diff
Type: application/octet-stream
Size: 21942 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20201214/ed39dc68/attachment-0001.obj>


More information about the pgpool-hackers mailing list